The Shaykh (Al-Mufid), may Allah سبحانه وتعالى support him, said: "If one doubts whether he performed the bowing while he is still standing, then let him bow. But if he has already entered another position, such as prostration or otherwise, then let him continue with his prayer and there is nothing upon him." This also applies if he is in the last two rak’ahs (of a four-unit prayer), because if the doubt occurs in the first two rak’ahs, he must restart the prayer, as he has not completed their number with certainty, and there is a saying that any forgetfulness that occurs in the first two rak’ahs obligates repeating the prayer. What supports the first category (that he continues if the doubt occurs in the last two) from what has preceded is what was narrated:
Commentary #13