The Shaykh (Al-Mufid), may Allah سبحانه وتعالى support him, said: “And likewise, if one is forgetful and does not know whether he is in the second or the fourth rak‘ah, if his assumption is stronger toward one of them, then he should act according to his assumption. But if his assumption is equal between them, then he should act as if he is in the fourth rak‘ah, perform the tashahhud, and when he gives the taslim, he should stand and pray two rak‘ahs while standing, reciting al-Hamd (Surah al-Fatiha) alone in each of them, and if he wishes, he may recite tasbih instead.”
Commentary #9