Chapter: 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
Jabir b. 'Abdullah reported: The Apostle 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.
Authentic