Q: Can I stay home if I am sick or afraid I may get sick by attending prayer in the masjid?
A: The ill are excused from attending the congregational and Friday prayers. This is based on a ḥadīth reported by al-Bukhari and Muslim which states that “The Prophet (peace be upon him) stayed away from the masjid when he fell ill and ordered Abu Bakr to lead people in prayer”.
As reported by Abu Dawud, the Prophet (peace be upon him) also explained the legal excuse to mean “fear and sickness” which means that, so long as they are not already in the masjid, anyone who fears falling ill, fears their illness worsening, or fears their recovery being delayed may also forgo attending the Friday and congregational prayers.
Kashshaf al-Qina’ & Sharh al-Muntaha