When and in which situations a Muslim is exempted from performing ritual prayer?
Prayer is fardh upon every Muslim who is sane and has reached puberty. Those who do not have these qualifications are not responsible for prayer. Because Prophet Muhammad (saw) said that children and insane people were not responsible for prayer (Abu Dawud, Hudud, 16).
In some cases, people with health issues are exempted from the ritual prayer. According to Hanafis, a person who is so sick that he is unable to establish ritual prayer even by moving his head is not responsible for anything. If such a person dies from this disease, s/he will not have any debt of prayer in the presence of Allah as he had no chance to establish qada (make-up) prayers. But if one recovers, s/he needs to make up for the missed prayers unless the number of missed prayers exceeds five. If it is more than five, that person is not required to make up the missed according to the preferred opinion. The same provisions are valid for the unconscious person in consideration to the duration of the unconsciousness. (Kasani, Bada’i, I, 106, 107, 108). Imam Shafi’i said that if a person stays unconscious for the duration of a whole prayer time, s/he does not need to perform qada (make up) prayer (Shirbini, Mughni al-muhtaj, I, 204).
A person who is confined to bed for lifetime may perform tayammum by using a brick, tile, or stone near him if he cannot get up to perform ablution or cannot find anyone to help him to perform it. A person who cannot get up from his bed and face the qiblah on his own, and if there is no one to help him, performs his prayer by moving his head, and turning his face towards the qiblah as much as he can, without getting up. (Sarakhsi, al-Mabsut, I, 112-113; Kasani, Bada’i, I, 48).
Those who cannot perform tayammum alone due to sickness and cannot find another person to help them may establish prayers by considering themselves as ritually clean and by moving their head if they want; or they may establish qada for the missed prayers later if they wish to do so. They make up their missed prayers when they recover, and such people are exempted from the ritual prayer if they do not recover (Ibn Nujaym, al-Bahr, I, 246-249,151; Haskafi, al-Durr al-mukhtar, I, 184-185, 423; Ibn Abidin, Radd al-Muhtar, I, 185, 423).
Source: Presidency Of Religious Affairs The Turkey, High Board of Religious Affairs FATWAS