It is narrated from Sayyiduna Ibn Umar (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) went out to Quba'. People of the Ansar came and began greeting him with salam while he (peace and blessings be upon him) was praying. As they were greeting him, Ibn Umar (may Allah be pleased with them both) said: O Bilal! How did you see the Messenger of Allah (peace and blessings be upon him) reply to the greeting? He said: Like this, and he gestured with his whole hand to show that he was gesturing in this way.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3402