´It was narrated from Abu Hurairah that:` "a man entered the masjid, and the Messenger of Allah(ﷺ) was sitting in a corner of the mosque. He prayed, then he came and greeted him with Salam(peace), and he said: 'Wa 'alaikassalm."
Hadith ReferenceSunan Ibn Majah / Chapters on Etiquette / Hadith: 3695
Hadith Gradingالألبانی:صحيح | زبیر علی زئی:متفق عليه