Answered by Shaykh Faraz Rabbani
Is rocking in prayer considered excessive movement?
In the name of Allah, Most Compassionate, Most Merciful,
Allah Most High says in the Qur’an,
“Stand in prayer reverently.” [2.238]
The ruling of rocking would depend on how the person was rocking. Slight rocking without need would be improper; doing so consistently without need, but with slight movements, would be prohibitively disliked because it would be considered fidgeting; doing so such that it fits the definition of excessive movement–explained in the answer below–would invalidate the prayer. [Ibn Abidin, Radd al-Muhtar]
And Allah alone gives success.
Faraz Rabbani.
Please see the following link in answer to your question: