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.
Jabir b. 'Abdullah reported: I went with the Messenger of Allah ( صلی اللہ علیہ وسلم ) on an expedition and my camel delayed me and I was exhausted. The Messenger of Allah ( صلی اللہ علیہ وسلم ) thus came earlier than I, whereas I came on the next day and went to the mosque and found him (the Holy Prophet) at the gate of the mosque. He said: It is now that you have come. I said. Yes. He said: Leave your camel and enter (the mosque) and observe two rak'ahs. He (the narrator) said: So I entered and observed (two rak'ahs) of prayer and then went back.
Ka'b b. Malik reported: The Messenger of Allah ( صلی اللہ علیہ وسلم ) did not come back from the journey but by day in the forenoon, and when he arrived, he went first to the mosque, and having prayed two rak'ahs in it he sat down in it.