Abu Hurayrah (may Allah be pleased with him) reported that the Prophet (may Allah's peace and blessings be upon him) said: "The Imām is appointed so that he should be followed; so, do not act differently from him. When he makes Takbīr all of you should say it after him; bow when he bows; say 'O our Lord, all praise be to You' when he says: Allah hears the one who praises Him; prostrate when he prostates; and all of you should pray sitting when he prays sitting."
عن أبي هريرة -رضي الله عنه- مرفوعاً: «إنما جُعِلَ الإمام ليِؤُتَمَّ به، فلا تختلفوا عليه، فإذا كبر فكبروا، وإذا ركع فاركعوا، وإذا قال: سمع الله لمن حمده، فقولوا: ربنا ولك الحمد. وإذا سجد فاسجدوا، وإذا صلى جالسا فصلوا جلوسا أجمعون».
شرح الحديث :
The Prophet (may Allah's peace and blessings be upon him) mentioned the wisdom behind appointing an Imām, which is that the worshipers should follow him in their congregational prayer. They should not act differently from him in the actions of the prayer. Rather, the Imām's movements during the prayer should be observed and followed in the same order he does them. Thus, when the Imām says Takbīr, then the congregation should follow him in doing so. When the Imām bows then they all should follow him, and when the Imām reminds them that Allah will answer the ones who praise Him by saying "Allah hears the one who praises Him", then they should praise Allah by saying: "Our Lord, praise be to You". When the Imām prostrates, Muslims praying behind him should prostrate as well, and if he prays sitting because he is unable to stand, then all of them should pray sitting as well even if they are able to stand. This is how the Imām should be followed.