Praise be to Allah.
Offering prayer in congregation in the mosque is obligatory for men who are able to do it, according to the more correct of the two scholarly views, because of evidence that has been explained previously in the answers to questions no. 8918 and 120.
In the case of one who is sick or paralysed, if it is difficult for him to go to the mosque, then he is excused for not praying in congregation. But whenever he has the strength to go, or he has someone who can help him to go, then he should pray in congregation.
Its says in Kashshaaf al-Qinaa‘ (1/495):
One who is sick is excused for not praying Jumu‘ah or offering prayers in congregation, because when the Prophet (blessings and peace of Allah be upon him) was sick, he did not go to the mosque, and he said: “Tell Abu Bakr to lead the people in prayer.” Agreed upon. The one who is afraid of becoming sick may also be excused because of the report narrated by Abu Dawood from Ibn ‘Abbaas, according to which the Prophet (blessings and peace of Allah be upon him) explained that people are excused in the event of fear, sickness, fear of exacerbating sickness or delaying recovery because he is sick. But if the sick person will not be harmed by going to the mosque, riding or being carried or if someone offers to give him a ride or carry him, or if a blind person has someone to lead him, then he must attend Jumu‘ah, because it is not repeated, but that does not apply to prayers in congregation. Al-Marwazi narrated concerning Jumu‘ah: He should rent a mount to go to the prayer. Al-Qaadi interpreted it as meaning that is if he still feels weak after recovering from sickness but if he is still sick, he does not have to attend, because the excuse is still present. End quote.
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said: With regard to prayer in congregation, we have stated above that there is a difference of opinion concerning it, and that the view that is most likely to be correct is that which says that it is an individual obligation, but the emphasis on it is not like the emphasis on Jumu‘ah prayer. Nevertheless, these two prayers are waived if there is an excuse. Excuses are of different types.
The phrase “One who is sick is excused for not praying Jumu‘ah or offering prayers in congregation” refers to one type of excuse.
What is meant is sickness that will cause the sick person hardship if he goes and prays. This is the first type.
The evidence for that is as follows:
1. The verse in which Allah, may He be exalted, says (interpretation of the meaning): “So keep your duty to Allah and fear Him as much as you can” [at-Taghaabun 64:16].
2. The verse in which Allah, may He be exalted, says (interpretation of the meaning): “On no soul does Allah place a burden greater than it can bear” [al-Baqarah 2:286].
3. The verse in which Allah, may He be exalted, says (interpretation of the meaning): “No blame or sin is there upon the blind, nor is there blame or sin upon the lame, nor is there blame or sin upon the sick” [al-Fath 48:17].
4. The words of the Prophet (blessings and peace of Allah be upon him): “If I instruct you to do something, do as much of it as you can.”
5. The fact that when the Prophet (blessings and peace of Allah be upon him) fell sick, he did not offer prayers in congregation, despite the fact that his house was beside the mosque.
6. Ibn Mas‘ood (may Allah be pleased with him) said: I remember a time when no one stayed away from prayer (in congregation) except a hypocrite whose hypocrisy was known or one who was sick…
All of this evidence indicates that the obligation to attend Jumu‘ah and prayer in congregation is waived in the case of one who is sick.
End quote from ash-Sharh al-Mumti‘ (4/310)
If a person is excused for not attending prayers in congregation, the hadith “There is no prayer for the neighbour of the mosque except in the mosque” does not apply to him. That applies to one who stays away from prayer in congregation with no excuse, as in the hadith that was narrated by Abu Dawood (551), Ibn Maajah (793), Abu Haatim, and Ibn Hibbaan in his Saheeh from Ibn ‘Abbaas who said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “Whoever hears the call and does not come, his prayer is not valid, except for those who have an excuse.” This hadith was also narrated by al-Haakim, who said: It is saheeh according to the conditions of the two shaykhs (al-Bukhaari and Muslim). Adh-Dhahabi did not comment on it. Al-Albaani said in al-Irwaa’ (551): It is as they said. In at-Talkhees, al-Haafiz classed the isnaad of Ibn Maajah and al-Haakim as saheeh.
The hadith “There is no prayer for the neighbour of the mosque except in the mosque” was narrated by ad-Daaraqutni, al-Haakim and al-Bayhaqi. It was classed as da‘eef by al-Haafiz Ibn Hajar in al-Fath (1/439) and by al-Albaani in as-Silsilah ad-Da‘eefah (1/332). See question no. 132492.
We ask Allah to reward you for what has befallen you and to help you to obey Him and attain His good pleasure.
And Allah knows best.