All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
Voluntary prayer is of two kinds:
First, the praying person who does not intend to perform a fixed number of Rak’ahs, may finish his prayer after performing whatever number he likes.
Second, the person who intends to perform a certain number of Rak’ahs, may change his intention and may increase or decrease the number of Rak’ahs anytime during prayer, provided the intention is changed before making the increase or decrease in the Rak’ahs.
If a person increases or decreases in his prayer deliberately without changing his intention, then his prayer becomes invalid.
If any increase or decrease occurs in number of Rak’ahs due to forgetfulness, then the prayer is valid. If any decrease occurs due to forgetfulness in the number of Rak’ahs he intended, then he has to complete all the numbers of Rak’ahs he intended. If there is an increase in the number of Rak’ahs due to forgetfulness, then he has to make two prostration due to forgetfulness.
Based on the above details you may know that changing the intention during the Thuha prayer from two to four is permissible.
Second, changing one's intention from an obligatory prayer to a common voluntary prayer is permissible only when one wants to join a congregational prayer; i.e., one has started performing an obligatory prayer individually and then he sees that some people are performing the prayer in congregation. At that time, he may change his intention to a common voluntary prayer and after finishing it, he may join the others to pray in congregation. Thus, it is not permissible for you to change your intention from an obligatory prayer to certain voluntary prayers, which are referred to as Sunnah Raatibah.
For more benefit on supererogatory [Sunnah or Rawaatib] prayers, please refer to Fataawa 20804, 233800, 102385 and 88390.
Allah knows best.