Anas bin Malik reported,

A Jewish man passed by the Messenger of Allah ﷺ and said, "As-samu alayka" (death be upon you).The Messenger of Allah ﷺ replied, "And upon you."Then the Messenger of Allah ﷺ said, "Do you know what he said? He said, 'Death be upon you.'"They said, "Messenger of Allah, shall we not kill him?"He said, "No. When the People of the Book greet you, respond by saying, 'And upon you.'"

Bukhari 6926

Sahih

حدثنا محمد بن مقاتل أبو الحسن أخبرنا عبد الله أخبرنا شعبة عن هشام بن زيد بن أنس بن مالك قال سمعت

أنس بن مالك يقول

مر يهودي برسول الله ﷺ فقال السام عليك فقال رسول الله ﷺ وعليك فقال رسول الله ﷺ أتدرون ما يقول قال السام عليك قالوا يا رسول الله ألا نقتله قال لا إذا سلم عليكم أهل الكتاب فقولوا وعليكم

البخاري 6926صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Demanding repentance from apostates and obstinate disbelievers and fighting them
Chapter
When a dhimmi or other person alludes to insulting the Prophet ﷺ without being explicit, such as saying "death be upon you"
Numbering
Darussalam 6926
Bukhari 6926