Sahih al-Bukhari #1170
Prayer at Night (Tahajjud) 19:49
Narrated Jabir bin `Abdullah:
While delivering a sermon, Allah's Messenger (ﷺ) said, "If anyone of you comes while the Imam is delivering the sermon or has come out for it, he should offer a two rak`at prayer."