A fatwa on the permissibility of not attending Friday and congregational prayers has been issued by many Islamic organisations including this one:
"If the epidemic reaches the level whereby one has a fear of contracting the Coronavirus, there is scope to not attend the Friday and other congregational prayers. This is because scholars have excused such attendance for example when there is heavy rain, which is less likely to result in death than contracting the said virus. And Allah knows best.
(1/160) و في الفتاوى الهندية
إذا أصاب الناس مطر شديد يوم الجمعة فهم في سعة من التخلف.
و في ارشاد الساري شرح صحيح البخاري : كتاب الجمعة ,
(2/488)باب الرخصة إن لم يحضر الجمعة في المطر
" إن الجمعة عزمة " بفتح العين و سكون الزاى, أي واجبة فلو تركت المؤذن يقول حي على الصلاة لبادر من سمعه الى المجيئ في المطر فيشق عليهم فأمرته أن يقول صلوا في بيوتكم لتعلموا أن المطر من الأعذار التي تصير العزيمة رخصة. وهذا مذهب الجمهور.
(2/300) و في الإنصاف في معرفة الراجح من الخلاف: كتاب الصلاة, باب صلاة الجماعة
قوله (يعذر في ترك الجمعة و الجماعة المريض) بلا نزاع. ويعذر أيضا في تركهما لخوف حدوث المرض."
There are though wider issues which need to be addressed from a religious perspective, such as whether the mosques themselves should be closed for now. In this regard the teachings of the faith repeatedly emphasise that preservation of life and health take precedence. Thus when a person is unwell the obligations of Hajj, fasting, prayer and purification take this into consideration and change accordingly.
Consequently, in an area which is affected by the Coronavirus, mosques may announce the Friday and congregational prayers can be prayed at home in line with the above ruling where rain was stated to be a sufficient reason not to attend the Friday prayer based on a narration cited in Sahih al-Bukhari. Indeed, the Muslim community was instructed in this narration to avoid coming to the mosque by instead praying at home.[1] Although where possible a small group of individuals numbering four, could continue to offer Friday and congregational prayers in the mosque rather than closing it down, as long as a lockdown has not been ordered by the government.
On the other hand, if the situation were to deteriorate further whereby the government imposed a complete lockdown due to a heightened risk of contracting the virus, then as per the above stated principles on the preservation of life and health, a mosque may be temporarily closed in terms of its prayer facility.[2] However, where possible its remaining activities are to continue online through its website, social media and remotely, until the viral threat passes. And as in the case of heavy rain, prayers are offered at home.[3]
Fiqh Council Birmingham
[1] Ibn Abbas said to his mu’adhdhin on a rainy day: When you say I bear witness that Muhammad is the Messenger of God, do not say “Come to prayer” say: “Pray in your homes.” It was as if the people found it objectionable, he said: It was done by one who is better than me, indeed the Friday prayer is compulsory, and I disliked that the people are placed in hardship and end up walking on mud and slippery ground. See Sahih al-Bukhari: The Book of Friday prayer, the chapter of the dispensation for not attending Friday prayer during rain, 1:366. In a similar narration this time recorded in Sahih Muslim it additionally states: 'It was done by one who is better than me, namely the Prophet peace be upon him.' See Sahih Muslim: The chapter on prayer at home during rain, 326-27.
[2] For example al-Zayla'i states the closure of the mosque outside prayer time is sanctioned to protect its property from theft, as a ruling may change due to changing times (لان الحكم قد يختلف باختلاف الزمان). See al-Zayla'i, Tibyin al-Haqa'iq Sharh Kanz al-Daqa'iq, 1:419; al-Kalaybuli, Majma al-Anhur fi Sharh Multaqa al-Abhur, 1:190-91.
[3] See also a joint fatwa (including its English translation) endorsed by UK Muftis, scholars and Imams: https://islamicportal.co.uk/wp-content/uploads/2020/03/Statement-of-senior-UK-scholars-on-Coronavirus-and-Masjids-Urdu-and-English.pdf