Can you pray Salah at home even though you live nearby to a mosque?
Praying in congregation is a Sunnah Mu’akkadah or Wajib. The latter being the stronger opinion and that which is held by Imam Ahmed Rida Khan (رحمة الله عليه) in his Fatawa. Therefore one should try to attend the congregation prayer but if he prayed at home the prayer will be done.
The Hadith, “There is no Salah for the neighbour of the Masjid but in it.” is a negation of the virtues of such prayer rather than a negation of its actual validity. This is the explanation given by the Ulama.
Allah knows best
Answered by Shaykh Naveed Jameel ash-Shaami