Kindly refer to the following link(s):
What to do when forced to utter words of Blasphemy?
Held at gunpoint to utter words of kufr, suicide if he doesn’t utter or is he martyr?
Related Article:
Do things people say against Islam when angry make them kafir?