Abdullah bin Umar reported,

The Messenger of Allah ﷺ came to the Quba mosque to pray there. Some men from the Ansar came and greeted him with salaam.I asked Suhayb, who was with him, "How did the Messenger of Allah ﷺ return their greetings?"He replied, "He would gesture with his hand."

Azami 2646

Sahih

عن ابن عمر قال

أتى رسول الله ﷺ مسجد قباء يصلي فيه. فجاءت رجال من الأنصار يسلمون عليه. فسألت صهيبا، وكان معه: كيف كان رسول الله ﷺ يرد عليهم؟ قال: كان يشير بيده.

الأعظمي 2646صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Prayer
Chapter
Minor actions do not invalidate the prayer
Section
Returning the greeting by gesture during prayer
Numbering
Jami al-Kamil 2646 (2nd edition)
Azami 2646