Praise be to Allah, the Lord of the Worlds; and may His blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
Tahiyyat al-Masjid (praying the two Rak'ah of salutation to the mosque) is a confirmed Sunnah for any person who enters the mosque being pure and wishing to sit down.
As regards the people who pray outside the mosque, then they do not have to pray 'Tahiyyat al-Masjid', and can sit down without praying the two Rak'ah. Because Tahiyyat al-Masjid are to be prayed by a person who enters the mosque, in a state of purity, and wishing to sit down.
Allah knows best.