Joined the Imam in the last two

A: The Rak`ah which the latecomer catches with the Imam is considered his first Rak`ah. So, whoever catches one Rak`ah of Al-Maghrib Prayer with the Imam, it will be his first Rak`ah. When he stands up to complete his Salah after the Imam concludes his Salah, he should recite in the first Rak`ah which he makes up alone Al-Fatihah and a Surah or some Ayahs because it is considered his second Rak`ah and he should sit for the middle Tashahhud. When he stands up to make up for the last Rak`ah of Al-Maghrib, he should recite only Al-Fatihah because it is the third Rak`ah for him, then he sits for the last Tashahhud. If he misses only one Rak`ah of the Maghrib Salah and catches two Rak`ahs with the Imam, he should recite Al-Fatihah in the last Rak`ah which he is making up for after the salutation of the Imam because it is his third Rak`ah.If the Salah is composed of four Rak`ahs and he catches three (Part No. 7; Page No. 323) or two Rak`ahs with the Imam, he should recite Al-Fatihah only in the one or two Rak`ahs he is making up for because it is the last Rak`ah of his Salah. He is not obliged to recite another Surah with Al-Fatihah according to the most preponderant opinion of the jurists.May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.