The imam is to be followed

Follow the imam; do not go ahead of him or differ from him.

Narrated by Abu Hurairah

The imam is appointed to be followed, so do not differ from him. When he says Allahu Akbar, say Allahu Akbar; when he bows, bow; when he says Sami'a Allahu liman hamidah, say Rabbana wa lakal-hamd; when he prostrates, prostrate.

Sahih al-Bukhari 722, Sahih Muslim 414

What this hadith teaches

In congregation each movement comes just after the imam's, never before and not long after.

Reference and grade

Grade
Sahih: agreed upon by al-Bukhari and Muslim
Narrator
Abu Hurairah

The hadith in Arabic نص الحديث

إِنَّمَا جُعِلَ الإِمَامُ لِيُؤْتَمَّ بِهِ فَلاَ تَخْتَلِفُوا عَلَيْهِ، فَإِذَا رَكَعَ فَارْكَعُوا، وَإِذَا قَالَ سَمِعَ اللَّهُ لِمَنْ حَمِدَهُ‏.‏ فَقُولُوا رَبَّنَا لَكَ الْحَمْدُ‏.‏ وَإِذَا سَجَدَ فَاسْجُدُوا، وَإِذَا صَلَّى جَالِسًا فَصَلُّوا جُلُوسًا أَجْمَعُونَ، وَأَقِيمُوا الصَّفَّ فِي الصَّلاَةِ، فَإِنَّ إِقَامَةَ الصَّفِّ مِنْ حُسْنِ الصَّلاَةِ

Arabic text of Sahih al-Bukhari 722, as given on sunnah.com.