Messenger of Allah ﷺ said, "If the Imam leads the prayer correctly then he and you will receive the rewards but if he makes a mistake (in the prayer) then you will receive the reward for the prayer and the sin will be his."
أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ يُصَلُّونَ لَكُمْ فَإِنْ أَصَابُوا فَلَكُمْ وَإِنْ أَخْطَئُوا فَلَكُمْ وَعَلَيْهِمْ