Remembering Missed Prayer after the Current Prayer Is Due
In the name of Allah, we praise Him, seek His help and ask for His forgiveness. Whoever Allah guides none can misguide, and whoever He allows to fall astray, none can guide them aright.
There is a difference of opinion among the jurists regarding making up the missed prayers. The first view is that it is permissible to offer the isha’ prayer with the imam the (current) prayer that he is praying, and then make up the missed prayer (Maghrib).
The second view is that the missed prayers should be offered in order. Hence, one can join the imam in the Isha’ Prayer, with the intention of praying Maghrib, then you should sit in the third rak`ah and recite the Tashahhud and say the tasleem, then join the imam in what is left of Isha’ prayer. Or wait during the Tashahhud until the imam finishes the prayer and say the tasleem with him, then pray Isha’.
In General, if one forgets or has a legitimate excuse for delaying a prescribed prayer and does not remember until the time for the next prayer begins, then he remembers it, there are three cases here:
1- If one remembers the missed prayer before starting to offer the current prayer. In this case one should start with the missed prayer, then prays the prayer that is currently due.
2- One has already offered the current prayer and completed it, then he remembered that he still has to make up the missed prayer that he has not prayed yet. His current prayer is valid and he only has to pray the missed prayer.
3- One remembers during the current prayer that he did not pray the previous prayer, which he missed. So he should complete the current prayer, then he should pray the prayer his missed.Soucre Link