It is narrated from Sayyiduna Abdullah bin Umar (may Allah be pleased with them) that the Messenger of Allah (peace and blessings be upon him) entered the mosque and began to pray. The Ansar companions (may Allah be pleased with them) came and greeted him with salam. I asked Sayyiduna Suhaib (may Allah be pleased with him): How did the Messenger of Allah (peace and blessings be upon him) reply to their salam (while in prayer)? He replied: He (peace and blessings be upon him) would respond by gesture.
Hadith Referenceالسنن المأثورة / باب ما جاء في صلاة الخوف / 64
Hadith Takhrijسنن ابن ماجہ، الصلاة باب المصلی لیسلم علیہ کیف یرد، رقم: 1017؛ سنن نسائی، السهو، باب رد السلام بالاشارة فی الصلاة، رقم: 1187۔