Assalaamu alaykum. I went to pray the ‘Ishaa prayer at the Imam Abdul Wahhab Mosque in Qatar yesterday, with my son, who is six years old. The security guard at the entrance of the masjid did not allow me to go inside the masjid since my son is below seven years old. While the imam started the prayer, I was told by the security guards to either pray outside the masjid or leave the kid outside by himself. The security guard informed me that this was the decision made by the ministry of Islamic affairs. Since it is a decision made by the ministry of Islamic affairs, can I pray outside the masjid (by myself) while following the imam who is performing the prayer inside? As a muslim, I have a right to join the congregational prayer in the masjid, which is 27 times better than praying by myself. If some one prevents me from doing this deed, then how am I need to deal with the situation? Allaah knows best!
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 not valid to follow the imaam when you are outside the mosque while there are places inside it, especially if you are praying by yourself. The prayer of one praying by himself behind the row without excuse is not valid even inside the mosque according to the view of some scholars. So it is with greater reason that it is not valid if it is outside the mosque.
For more benefit on the ruling on praying outside the mosque while there are places inside the mosque, please refer to fatwa 91988.
Also, for more benefit on the prayer of a person individually behind the row when he is led by an imaam, please refer to fatwa 350431.
If you are prevented from entering the mosque, you will receive the full reward of the prayer, Allah willing, and the one who prevented you from doing so is sinful.
Allah knows best.
You can search for fatwa through many choices