It is narrated from Sayyiduna Jabir (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) was delivering a sermon when Sulaik came and sat down. The Prophet (peace and blessings be upon him) ordered him to pray two rak‘ahs, then turned to the people and said: When any one of you comes while the Imam is delivering the sermon, he should pray two short rak‘ahs.
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 14171