Sahih Muslim Book 4, Hadith 131
This hadith has been narrated by A'mash with the same chain of transmitters.
The Messenger of Allah (ﷺ) came to us and said: "How is it that I see you lifting your hands like the tails of headstrong horses? Be calm in prayer." He (the narrator) said: He then again came to us and saw us (sitting) in circles. He said: "How is it that I see you in separate groups?" He (the narrator) said: He again came to us and said: "Why don't you draw yourselves up in rows as angels do in the presence of their Lord?" We said: Messenger of Allah, how do the angels draw themselves up in rows in the presence of their Lord? He (the Holy Prophet) said: "They make the first rows complete and keep close together in the row."
When we said prayer with the Messenger of Allah (ﷺ), we pronounced: Peace be upon you and Mercy of Allah, peace be upon you and Mercy of Allah, and made gesture with the hand on both the sides. Upon this the Messenger of Allah (may peace be upon him said: What do you point out with your hands as if they are the tails of headstrong horses? This is enough for you that one should place one's hand on one's thigh and then pronounce salutation upon one's brother on the right side and then on the left.