When should the one who is praying behind an imam move?
Question

What is meant by following the imam and preceding him?
Praise be to Allah.Following the imam means waiting until he has completed the movement and until his voice has finished saying the takbeer, and then following him. If the imam says the takbeer for rukoo’, the worshipper should remain standing until the imam has finished saying takbeer and has bowed, then he should bow. When the imam rises from the rukoo’, the worshipper should remain bowing until the imam has finished saying “Sami’a Allahu liman hamidah,” and then stand up. This applies to all the movements of the prayer. Preceding the imam means bowing or prostrating before the imam, or starting any movement before him; this invalidates the prayer or reduces its reward.