Allah, may He be glorified and exalted, says (interpretation of the meaning):
“So keep your duty to Allaah and fear Him as much as you can”
“Allaah burdens not a person beyond his scope”
So if a person has a pain in his head which makes it difficult for him to prostrate on the ground and he will be harmed by that, there is nothing wrong with him making gestures, and his gesture for prostration should be deeper than his gesture for bowing. There is nothing wrong with him bowing and prostrating in gestures, but his prostration should be deeper than his bowing, if it is too difficult for him to prostrate on the ground because of pain in his head or other sicknesses which prevent him from prostrating.
Shaykh ‘Abd al-‘Azeez ibn Baaz (may Allah have mercy on him)