The Prophet (peace and blessings be upon him) said:
"When any of you enters the mosque, he should not sit down until he has prayed two rak'ahs (tahiyyat al-masjid)."
Hadith Referenceصحیح الجامع الصغیر / حرف الألف / 513
Hadith Gradingالألبانی:صحيح
Hadith Takhrij[حم ق ٤] عن أبي قتادة [هـ] عن أبي هريرة. الروض ١٠٠٨، الإرواء ٤٦٧، رياض الصالحين ١١٥١.