It is narrated from Hazrat Abu Qatadah (may Allah be pleased with him) that the Noble Prophet (peace and blessings be upon him) said: When any one of you enters the mosque, he should perform two rak'ahs (as Tahiyyat al-Masjid) before sitting down.
Hadith Referenceمسند احمد / مسند الأنصار رضي الله عنهم / 22529