Two-rakah prayer: only the final sitting after the second rakah.
Three-rakah prayer: first sitting after the second, final sitting after the third.
Four-rakah prayer: first sitting after the second, final sitting after the fourth.
This determines whether to rise after tashahhud or proceed with salawat and taslim.