I.
With regard to praying `Isha’ behind someone who is praying Tarawih there is a difference of opinion among the jurists, but it is most likely that it is acceptable. This is the view of the Shafa`is and was also narrated from Ahmad.
See the answer to question no. 79136.
II.
When the imam said the taslim and you stood up to complete your prayer, you were then praying on your own, and there is a difference of scholarly opinion regarding your rejoining the congregation for Tarawih, because that means that one who was praying on his own had now joined the congregation. It would have been better for you to complete the prayer on your own.
An-Nawawi (may Allah have mercy on him) said, explaining that it is permissible to do that: If he prayed `Isha’ behind [an imam who was praying] Tarawih, that is permissible, and when the imam says the Taslim, he should stand up and complete the two remaining rak`ahs.
And the best is to complete them on his own.
So if the imam stands up to pray the last two rak`ahs of Tarawih, and he intends to follow him again in those two rak`ahs, there are two scholarly views as to whether it is permissible for one who started to pray on his own to then decide to follow the imam. The more correct view is that it is valid.
End quote from Al-Majmu` Sharh al-Muhadhdhab, 4/270.
Shaykh Ibn `Uthaymin (may Allah have mercy on him) was uncertain whether that is permissible, even though he held the view that it is permissible for one who is offering an obligatory prayer to pray behind one who is offering a supererogatory prayer.
See the answer to question no. 141250.
III.
Praying Tarawih four by four rak`ahs, with one or two tashahhuds [in each four-rak`ah prayer] is disliked (makruh) according to most of the scholars, and is prohibited according to some, in contrast to the Hanafis, who say that that is prescribed.
Al-Khatib ash-Sharbini ash-Shafa`i (may Allah have mercy on him) said: If he prays [Tarawih] with four rak`ahs and one taslim, that is not valid, because it is contrary to what is prescribed, unlike the Sunnah prayers of Zuhr and `Asr. The difference between them is that Tarawih, because it is prescribed to offer it in congregation, is akin to the obligatory prayers, so it cannot be changed and done in a manner other than that which is described in the reports.
End quote from Mughni al-Muhtaj, 3/159.
Al-Bahuti al-Hanbali (may Allah have mercy on him) said: If he prays more than two rak`ahs at night, even if he goes beyond eight, whether he remembers the number or forgets it, with one salaam, that is disliked (makruh), but the prayer is still valid.
End quote from Kashshaf al-Qina`, 3/308.
But if the imam does that following the view of Abu Hanifah (may Allah have mercy on him), there is nothing wrong with praying behind him.
See the answer to question no. 407542.
You prayed fourteen rak`ahs behind the imam, apart from Witr, and there is nothing wrong with that, but the best is to go early so that you can catch up with `Isha’ prayer in congregation with the imam and pray Tarawih with him from the beginning.
Muslim (656) narrated that `Uthman ibn `Affan said: I heard the Messenger of Allah (blessings and peace of Allah be upon him) say: “Whoever prays ‘Isha’ in congregation, it is as if he spent half the night in prayer, and whoever prays Fajr in congregation [too], it is as if he spent the whole night in prayer.”
An-Nasa’i (1364), at-Tirmidhi (806), Abu Dawud (1375) and Ibn Majah (1327) narrated that Abu Dharr said: We fasted Ramadan with the Messenger of Allah (blessings and peace of Allah be upon him) and the Prophet (blessings and peace of Allah be upon him) did not lead us in praying qiyam during any part of it, until there were seven nights of the month left. He led us in praying qiyam on the night of the twenty-third until approximately one-third of the night had passed. Then on the night of the twenty-fourth he did not lead us in prayer. Then he led us in praying qiyam on the night of the twenty-fifth until almost half the night had passed.
We said, O Messenger of Allah, would that you had continued to lead us in praying qiyam for the whole night. He said, “If a man prays with the imam until he finishes, it will be counted as if he spent the whole night in prayer.”
Classed as sahih by al-Albani in Sahih an-Nasa’i.
And Allah knows best.