In almost all of the mosques here, Witr is prayed in congregation after the 20 rakah Taraweeh prayer. But as far as I know, Witr is to be prayed after Tahajjud if someone wishes to pray Tahajjud. So I was wondering, what is the ruling about it? Should I just sit and ignore the Witr congregation because I want to pray the Tahajjud later in night?
If you want to pray more after tarawih, you shouldn't pray witr with the congregation.
Actually the witr prayer was never done in congregation by the Prophet. It's an individual prayer.
A man came to the Prophet and asked him how to pray the night prayer. The Prophet replied =
Pray two rakat at a time and then two and then two and so on, and if you are afraid of the dawn pray one rakat and that will be the witr for all the rakat which you have offered.
The witr is always the last prayer after the night prayer and before the dawn.
You have 3 options:
Sayyid's answer above.
See NRaf's answer
Pray Taraweeh and Witr with congregation then go somewhere else and pray more alone. However, after you finish praying then you are not allowed to pray Witr again.
Qais bin Talq bin Ali narrated that : his father said: I heard Allah's Messenger saying: "There are no two Witr in one night." At-Tirmdhi
The advantage of the 2nd and 3rd options is that you may be included under those mentioned in the hadith of the prophet (PBUH):
Whoever prays with the imam until he finishes, Allah will record for him as if he spent the whole night in prayer [Collected by Tirmidhi]