Answer
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
If someone missed the first tashahhud and went standing up for the third rakah, he can either continue his prayer or come back down to the sitting position to say the tashahhud. At the end of the prayer and after the last tashahhud, he should perform sujud al-sahw (prostration of forgetfulness).
Answering your question, Sheikh Kifah Mustapha, the Imam and Director of The Prayer Center of Orland Park and representative for Dar El Fatwa of Lebanon in the US, states:
The first tashahhud (during a 3-rakah or 4-rakah prayer) is wajib; meaning it is an important act in prayer and you should not miss it.
The second or last tashahhud in any given prayer is a rukun; a pillar and you should not miss too.
If someone missed the first tashahhud and went standing up for the third rakah, he can either continue his prayer or come back down to the sitting position to say the tashahhud. At the end of the prayer and after the last tashahhud, he should perform sujud al-sahw (prostration of forgetfulness). Sujud al-sahw is adding two prostration acts before you make your final salam.
If someone missed the last tashahhud and stood up for additional added rakah that is not part of the prayer he MUST go back to the sitting position to read his last tashahhud. After he finishes it, he must add two prostration acts of sujud al-sahw and then say the salam.
If the person was an Imam, the people behind him should remind him by saying Subhan Allah for males or clapping for females and act properly.
In case the person was praying alone and he forgot totally but remembered right after the prayer, he should stand up and make up one full rakah with a final tashahhud. If time has passed long, it is better he repeats the whole prayer.
Almighty Allah knows best.