If the Imam remembers in the final tashahhud (sitting of the prayer) that he had recited at-tahiyyaat (the greetings mentioned during the sitting) in the beginning of the rak‘ah instead of Al-Fatihah, he should stand up and offer another rak‘ah, which is correct in exchange for the one he performed incorrectly and did not recite Al-Fatihah. This is because the Prophet (peace be upon him) said:There is no prayer for the one who did not recite (in it) Al-Fatihah (the opening chapter of the Qur’an).
(Sahih Al-Bukhari, No. 723)
It is also required for the followers to follow him even though it would be the fifth rak‘ah for them. If they do not understand and do not stand up, and say “subhan Allah” to indicate to Imam that he is error, the Imam should inform them by hand movements to the right and left to tell them that he did it purposefully and to indicate to them to stand up.
However, if something like this happens to one of the followers behind the Imam, his prayer will be correct as long as he followed his Imam.
The evidence for this is the Hadith of Abu Bakrah when he entered into the prayer in the position of ruku‘ and did not recite Al-Fatihah. The Prophet (peace be upon him) said to him:May Allah increase your endeavor. You do not need to repeat. (Sahih Al-Bukhari, No. 750)
If the follower forgets to recite Al-Fatihah or is ignorant of its obligatory nature or finds the Imam in the state of ruku‘, then his rak‘ah will be considered as complete and his prayer correct. He does not need to repeat the rak‘ah, as he is his excused due to ignorance or forgetfulness or if he missed catching the qiyam (the position standing upright). This is the opinion of the majority of scholars.1
Fatawa Islamiyyah by Ibn Baz, 1/263.