God’s Messenger led us in prayer one day, and when he finished his prayer he faced us and said, "O people, I am your imam, so do not bow, prostrate yourselves, stand, or go away before I do, for I see you both in front of me and behind me."
We used to pray behind the Prophet, and when he said, "God listens to him who praises Him," none of us bowed his back till the Prophet placed his forehead on the ground.
Abu Huraira reported God’s Messenger as saying, "Do not try to go ahead of the imam. When he says ‘God is most great’ say ‘God is most great’; when he says ‘Nor of those who err’ (i.e. the end of sura 1) say ‘Amen’; when he bows bow; and when he says ‘God listens to him who praises Him’ say, ‘O God, our Lord, to Thee be the praise’."
(Bukhari and Muslim, but Bukhari did not mention "and when he says, ‘Nor of those who err”’.)