We used to say behind the Messenger of Allah ﷺ when we gave the closing salutation, "Peace be upon you, peace be upon you," with each of us gesturing with his hand to his right and to his left.The Messenger of Allah ﷺ said, "What is the matter with these people who flick their hands during the prayer as though they were the tails of restless horses? Is it not enough for one of you to place his hand on his thigh and then give the salutation to his right and to his left?"
حدثنا محمد بن عبيد حدثنا مسعر عن عبيد الله ابن القبطية قال سمعت
كنا نقول خلف رسول الله ﷺ إذا سلمنا السلام عليكم السلام عليكم يشير أحدنا بيده عن يمينه وعن شماله فقال رسول الله ﷺ ما بال الذين يرمون بأيديهم في الصلاة كأنها أذناب الخيل الشمس ألا يكفي أحدكم أن يضع يده على فخذه ثم يسلم عن يمينه وعن شماله