Teaching the Rulings Regarding Prayer- Tartīb (sequence)
A worshipper must perform the acts of prayer in sequence, that is he or she must perform rukū' before sajdah and tashahhud after sajdah. This is called tartib, which is among the obligatory non-rukns of prayer.
If one intentionally breaks the sequence of prayers, for instance if they say tashahhud and then go in to sajdah, their prayer becomes invalid.
But if tartib is broken inadvertently and the worshipper has not gone in to the next rukn, for example If they are in the middle of saying tashahhud without having gone in to sajdah, they must return and perform sajdah and then perform tashahhud.
But if the worshipper has gone in to the next rukn of prayer, i.e. for example he or she has performed only one sajdah and then has stood up and recalls not having performed sajdah, in that case his or her prayer is valid.
Except if the missed part is among the rukns of prayer, for example if they have forgotten both of the sajdahs and have gone in to the next rak'ah, in which case the payer becomes invalid.