Greeting the mosque

Offering the Prescribed Sunnah Or Greeting the Mosque?

What is the ruling of Tahiyat Al-Masjid (Greeting the mosque)? When could one offer it? ...