Sayyiduna Anas bin Malik (may Allah be pleased with him) said: "When entering the mosque, put the right foot in first, and when leaving, take the left foot out first. This is the Sunnah."
Only Shaddad bin Sa'id Abu Talhah al-Rasibi narrated it, and he is not strong.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 4322