Abdullah bin Masud reported,

We used to greet the Messenger of Allah ﷺ while he was in prayer, and he would return our greeting. When we returned from the court of the Negus, we greeted him but he did not return our greeting. He said, "In prayer one is occupied."

Azami 2594

Sahih

عن عبد الله بن مسعود قال

كنا نسلم على رسول الله ﷺ وهو في الصلاة فيرد علينا. فلما رجعنا من عند النجاشي سلمنا عليه فلم يرد علينا وقال: إن فى الصلاة شغلا

الأعظمي 2594صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Prayer
Chapter
What is prohibited and disliked in prayer
Section
Prohibition of returning the greeting during prayer
Numbering
Jami al-Kamil 2594 (2nd edition)
Azami 2594