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 Messenger of Allah ( صلی اللہ علیہ وسلم ) bought a camel from me. When he came back to Medina, he ordered me to come to the mosque and observed two rak'ahs of prayer.
Authentic