I prayed Zuhr when I had missed three rak’ahs, and when I had completed two rak’ahs I remembered that I had not prayed Fajr as I was sick. Then I stopped the prayer after the second rak’ah and intended that to be Fajr, and after that I prayed Zuhr
This question will be answered by addressing three points:
1 – The ruling on praying missed prayers in order:
Imaam Abu Haneefah, Imaam Maalik and Imaam Ahmad are of the view that it is obligatory to pray missed prayers in order when making them up. The evidence for that is the fact that when the Prophet (peace and blessings of Allaah be upon him) missed some prayers on the day of al-Khandaq, he made them up in order. Al-Bukhari (641) and Muslim (631) narrated from Jaabir ibn ‘Abd-Allaah that the Prophet (peace and blessings of Allaah be upon him) prayed ‘Asr on the day of al-Khandaq after the sun had set, then he prayed Maghrib after that. Al-Bukhaari (631) narrated that the Prophet (peace and blessings of Allaah be upon him) said: “Pray as you have seen me praying.” (al-Mughni, 2/336)
2 – If a person forgets to pray them in order, does that obligation no longer apply?
The answer is, yes, the obligation to pray them in order no longer applies if one forgets, because the Prophet (peace and blessings of Allaah be upon him) said: “Allaah will forgive my ummah for their mistakes and what they forget, and what they are forced to do.” (Narrated by Ibn Maajah, 2043; classed as saheeh by al-Albaani in Saheeh Ibn Maajah, 1662). This is the view of Imaam Abu Haneefah and Imaam Ahmad (may Allaah have mercy on them). See Fath al-Qadeer, 1/424; al-Mughni, 2/340; al-Sharh al-Mumti’, 2/139.
If a person forgets one prayer and does not remember until the time for the next prayer begins, then he remembers it, one of the following three scenarios must apply:
1- He remembers the missed prayer before he starts to offer the current prayer. In this case he has to start with the missed prayer, then pray the prayer that is currently due.
2- He prays the current prayer and completes it, then he remembers that he still has to do the missed prayer that he has not prayed yet. His current prayer is valid and he only has to pray the missed prayer, and he is excused for not praying them in the proper order because he forgot.
3- He remembers during the current prayer that he did not pray the previous prayer, which he missed. So he should complete the current prayer, which then becomes a naafil (supererogatory) prayer, then he should pray the prayer his missed, and then repeat the current prayer, in order to keep them in the proper order. This is the view of Imam Ahmad (may Allaah have mercy on him). See al-Mughni, 2/336-340). This is also the view of ‘Abd-Allaah ibn ‘Umar (may Allaah be pleased with them both). Imaam Maalik narrated in al-Muwatta’ (408) that Naafi’ ibn ‘Abd-Allaah ibn ‘Umar used to say, “Whoever forgets a prayer then remembers it only when he is with the imaam, then when the imaam says the salaam, let him pray the prayer that he had forgotten, then let him pray the other after that.” Shaykh al-Islam (Ibn Taymiyah – may Allaah have mercy on him) said: “When he remembers the prayer that he missed during the (current) prayer, it is as if he remembered before he started it. But if he does not remember until the current prayer is finished, then the current prayer is valid according to the majority of scholars, such as Abu Haneefah, al-Shaafa’i and Ahmad…” (al-Fataawa al-Kubra, 1/112)
His completing the prayer that he is currently praying is mustahabb (recommended), not waajib (obligatory). If he stops that prayer, then prays the prayer he missed, then prays the current prayer, that is permissible. Muhanna said: “I said to Ahmad, ‘I was praying ‘Isha, then I remembered that I had not prayed Maghrib. So I prayed ‘Isha’, then I prayed Maghrib and repeated ‘Isha’.’ Ahmad said, ‘You did right.’ I said, ‘Should I not have stopped praying when I remembered?’ He said, ‘Yes.’ I said, ‘So how did I get it right?’ He said, ‘Both are permissible.’” (al-Mughni, 2/339).
Some of the scholars are of the view that he should complete the (current) prayer that he is praying, and then do the missed prayer, and he does not have to repeat the current prayer. This is the view of al-Shaafa’i, as stated in al-Majmoo’, 3/70. This was also the view favoured by Shaykh Ibn ‘Uthaymeen (may Allaah have mercy on him). (Majmoo’ Fataawa Ibn ‘Uthaymeen, 12/221). But the first opinion is more on the safe side.
3 – The questioner says that he did not pray Fajr because he was sick
What he did was not correct, because sickness is not an excuse to delay the prayer until the time for prayer is over. Rather what the Muslim must do is to offer the prayer on time. If he is sick, he should pray as best he can, for Allaah does not burden a soul beyond what it is able to bear. If he is unable to stand, then he may pray sitting down. If he is unable to sit, then he may pray lying on his side. If he is unable to do wudoo’, then he should do tayammum. If there is some impurity on his body and he is unable to remove it, then he should pray as he is, and so on. It is not permissible for him to delay the prayer until the time for it is over because he is unable to purify himself or remove the impurity. Rather he should pray as best he can and do as much of the obligatory actions of prayer as he is able, and he is relieved of the obligation to do the things that he is unable to do. See the essay Ahkaam Salaat al-Mareed wa Tahaaratuhu by Shaykh Ibn Baaz.