The Desirability of Praying Two Rak`ah Upon Entering the Mosque Even During the Khutbah:
Abu Qataadah (radiyallaahu `anhu) said: “I entered the mosque while the Messenger of Allaah (sallallaahu `alaihi wa sallam) had been sitting with the people, so I also sat down among them. Upon this the Messenger of Allaah (sallallaahu `alaihi wa sallam) said:
“What prevented you from praying two rak`ah before sitting down?” I said:
“O Messenger of Allaah! I saw you sitting and the people sitting.” He said:
“When any of you enters the mosque, he should not sit until he has prayed two rak`ah.”
Reported by Al-Bukhaaree (930, 931) and Muslim (2015, 2017).
The Messenger of Allaah (sallallaahu `alaihi wa sallam) said: “If one of you comes to the Mosque while the Imaam is delivering the Khutbah, he should pray two light rak`ah (i.e. not making them long).”
Reported by Muslim (2021).