The two rak’ah Sunnah prayer after the Maghrib adhaan and before the iqaamah
Question: What is the ruling of (performing) the tahayyatul-masjid (two rak’ah Sunnah prayer upon entering the masjid and before sitting down) just after the adhaan of (the) Maghrib (prayer) and before the (Maghrib) prayer (itself), (considering) whilst the time period between the adhaan and the iqaamah is short; And also what is the ruling of (performing) the voluntary prayer before theMaghrib prayer?
Response: The tahayyatul-masjid (prayer) is a recommended Sunnah (to be done) at all times, even during the prohibited times (between after the Fajr prayer and sunrise and between after the’Asr prayer until Maghrib) according to the correct of the two opinions of the scholars, based upon the saying of the Prophet (sal-Allaahu `alayhe wa sallam):
«If any of you enter the masjid, then do not sit down until you pray two rak’ah», [It’s authenticity is agreed upon (by both Imaam al-Bukhaaree and Imaam Muslim]
As for the prayer after the Maghrib (prayer) adhaan, and before the iqaamah, (then) it is a Sunnahbased upon the saying of the Prophet (sal-Allaahu `alayhe wa sallam):
«Pray before the Maghrib (prayer), pray before the Maghrib (prayer)…» and thirdly he said:
«…whoever wishes (to do so)», [Transmitted by al-Bukhaaree]
And the companions of the Prophet (sal-Allaahu `alayhe wa sallam) would hasten to perform the two rak’ah (Sunnah) prayer before the iqaamah of (the) Maghrib (prayer) and the Prophet (sal-Allaahu `alayhe wa sallam) would see them (doing so) and did not prohibit them from that, rather he encouraged them in that as mentioned in the earlier hadeeth.
Shaykh Ibn Baaz
Silsilah Kitaab ad-Da ‘wah (1), al-Fataawa – Volume 1, Page 52 fatwaonline.com