Sayyiduna Abdullah (may Allah be pleased with him) narrates that when the Messenger of Allah (peace and blessings be upon him) was praying, whenever he would go into prostration, Sayyiduna Hasan and Husayn (may Allah be pleased with them both) would jump and sit on his back. When the companions tried to stop them, the Messenger of Allah (peace and blessings be upon him) would gesture to the companions to leave them (let them do as they wish). Then, when the prayer was completed, he seated both of them in his lap and said: "Whoever loves me should also love these two."
Explanation & Benefits
Shaykh Muhammad Farooq Rafi
Benefits:
➊ It is permissible to make a gesture in the prayer to warn against some wrong action, and it was the habit of the Prophet sallallahu alayhi wa sallam to gesture during the prayer.
➋ Furthermore, a gesture whose intended purpose is understood does not invalidate the prayer.
Source: Sahih Ibn Khuzaymah: Commentary by Muhammad Farooq Rafee, Page: 887