السلام عليكم و رحمة الله و بركاتهWhat are the essential conditions which make it allowed to pray outside the masjid (because masjid is full). And I do not want to pray on the 2nd floor because it is too hot over there.So can I pray at the doorstep of the masjid, or is it not allowed because such passages should not be occupied? What if I leave immediately after the salah? Masjid is full anyway,so none is suppose to leave during salah.
All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
It is permissible for you to follow the Imam who is in the mosque while you are praying outside the mosque, provided that you see the Imam or those who see him.
Some jurists are even more lenient about this matter and are of the view that it is permissible to follow the Imam as long as following him is practically possible (like being able to hear him without the ability to see him, for example).
In any case, your prayer inside the mosque is better and more rewardable.
Allah knows best.
You can search for fatwa through many choices