ANSWER:

You should stay until the second imam finishes with witr to get the reward as they both represent the imam of the masjid and not only one of them.

We have 20 rakah and two imaams for taraweeh prayer. First 10 rakah prays one imaam and the other 10 rakah prays the other imaam. Somebody said if we leave the mosque after the first imaam finishes his 10 rakah it will be counted as if we prayed the whole night as per the known hadith. Is this true or must we stay til the end to get the reward?

Prayer, Taraweeh, Tahajjud and Qiyam-ul-Layl |