بسم الله الرحمن الرحيم
In the Name of Allah The most Gracious The Most Merciful
Questioner: A person is late for Maghrib prayer, he enters the mosque and finds that the Imaam has started Ishaa prayer, or in the situation where he has to combine both Maghrib and Ishaa, he hasn’t prayed Maghrib, he enters the mosque and the Imaam has started Ishaa prayer—how does this person finish the Maghrib prayer, does he carry on with the Imaam or part with him?
Al-Albaani: In this situation he starts behind the Imaam who is praying Ishaa, but he makes the intention to pray Maghrib, in order to comply with putting one prayer before the other, but when the Imaam gets up for the fourth rak’ah [of Ishaa] this person makes the intention to part [with him], and remains sitting at the end of the third rak’ah, reads the tashahhud and gives salaam. Then he stands behind this Imaam who is still praying Ishaa and makes the intention to [now] pray Ishaa—whether or not he was able to join him before the rukoo’ [of the Imaam’s fourth rak’ah of Ishaa] or after it—what is important is that he joins [them] and prays Ishaa behind the Imaam after having prayed Maghrib with him.
Questioner: Ya’ni, he parts with him after the third rak’ah?
Al-Hudaa wan-Noor, 18. Source: The Albaani Blog