It is recommended to greet the masjid by praying two rak`ah, and it is disliked to sit before praying these two rak`ah, and this is prescribed at all times — Sahih Muslim | Quran & Hadees
It is recommended to greet the masjid by praying two rak`ah, and it is disliked to sit before praying these two rak`ah, and this is prescribed at all times
Abu Qatada (a Companion of the Prophet) reported Allah's Messenger (ﷺ) as saying: When any one of you enters the mosque, he should observe two rak'ahs (of Nafl prayer) before sitting.
Abu Qatada, a Companion of the Messenger of Allah (ﷺ), said: I entered the mosque, when the Messenger of Allah (ﷺ) had been sitting among people, and I also sat down among them. Upon this the Messenger of Allah (ﷺ) said:…
Jabir b. 'Abdullah reported: The Messenger of Allah (ﷺ) owed me a debt; he paid me back and made an addition (of this). I entered the mosque and he (the Holy Prophet) said to me: Observe two rak'ahs of prayer.