Abu Tamima reported,

A man from his people reported, "I was searching for the Prophet ﷺ but could not find him, so I sat down. Then a group of people came along, and he was among them, though I did not recognize him. He was reconciling between them. When he finished, some of them rose with him and said, 'Messenger of Allah.'When I saw this, I said, 'Upon you be peace, Messenger of Allah. Upon you be peace, Messenger of Allah. Upon you be peace, Messenger of Allah.'He said, 'Upon you be peace is the greeting for the dead. Upon you be peace is the greeting for the dead,' three times.Then he turned to me and said, 'When a man meets his Muslim brother, let him say, As-salamu alaykum wa rahmatullah.'Then the Prophet ﷺ returned my greeting, saying, 'And upon you, and the mercy of Allah. And upon you, and the mercy of Allah. And upon you, and the mercy of Allah.'"

Tirmidhi 2721

Sahih

حدثنا سويد أخبرنا عبد الله أخبرنا خالد الحذاء

عن أبي تميمة الهجيمي

عن رجل من قومه قال طلبت النبي ﷺ فلم أقدر عليه فجلست فإذا نفر هو فيهم ولا أعرفه وهو يصلح بينهم فلما فرغ قام معه بعضهم فقالوا يا رسول الله فلما رأيت ذلك قلت عليك السلام يا رسول الله عليك السلام يا رسول الله عليك السلام يا رسول الله قال إن عليك السلام تحية الميت إن عليك السلام تحية الميت ثلاثا ثم أقبل علي فقال إذا لقي الرجل أخاه المسلم فليقل السلام عليكم ورحمة الله ثم رد علي النبي ﷺ قال وعليك ورحمة الله وعليك ورحمة الله وعليك ورحمة الله

الترمذي 2721صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Permission and etiquette
Chapter
Disliking saying "peace be upon you" as a greeting initiator
Numbering
Darussalam 2721
Tirmidhi 2721