Sahih Muslim Book 4, Hadith Number 1904.

Chapter : Observing of two Rak’ahs as a salutation of the mosque while the Imam is delivering (the sermon).

Abu Rifa’a reported: I came to the Holy Prophet (way peace be upon him) when he was delivering the sermon, and I said: Messenger of Allah, here is a stranger and he wants to learn about this religion and he does not know what this religion is. The Messenger of Allah (may peace be upon him) looked at me and left his sermon till he came to me, and he was given a chair and I thought that Its legs were made of iron. The Messenger of Allah (may peace be upon him) sat In it and he began to teach me what Allah had taught him. He then came (to the pulpit) for his sermon and completed it to the end.