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.
There is nothing wrong with praying two Rak‘ahs of the three-Rak‘ah Witr prayer in the Masjid, end them with Tasleem (saying “As-Salaamu ‘Alaykum”), and then praying the last Rak‘ah of Witr at home. It is not required to perform the third Rak‘ah immediately after performing the two Rak‘ahs (of Witr). It is also not mandatory to pray three consecutive Rak‘ahs with one Tasleem at the end.
Therefore, it is permissible for you, dear brother, to separate between the three Rak‘ahs of the Witr prayer by performing two Rak‘ahs and then one Rak’ah. Moreover, you are not obliged to pray all three Rak‘ahs with one Tasleem (after the third Rak’ah) just because the people of this Masjid follow the Hanafi school of Fiqh. The matter is broad and not restricted (to one opinion).
As a matter of fact, Ibn Qudaamah pointed in Al-Mughni that the majority of the scholars hold that it is allowed to separate between the three Rak’ahs of the Witr prayer (as stated above), contrary to the opinion of Imam Abu Haneefah.
The opinion of the majority of the scholars is supported with stronger evidence. It was narrated on the authority of Ibn ‘Umar, may Allaah be pleased with him, that the Prophet said: “Perform the night prayers (Qiyaam) in pairs (two-Rak‘ah prayers), and if one of you fears the crack of dawn, then he should pray one Rak‘ah of Witr, which will make what he has prayed an odd number.” [Al-Bukhari and Muslim] Moreover, ‘Aa’ishah said when describing the manner of the Prophet’s night prayer: “…He would conclude the prayer by Tasleem after every two Rak‘ahs, then prays one Rak‘ah of Witr (at the end).” [Muslim]
Allah Knows best.