Praise be to Allah.
How Prophet Muhammad prayed witr?
It was proven that the Prophet (peace and blessings of Allah be upon him) prayed Witr in different ways . He prayed one rak`ah, and three, and five, and seven, and nine. And he prayed three rak`ahs in two different ways, either continuously with one tashahhud, or saying salam after two rak`ahs and praying one rak`ah and saying salam after it.
Is it permissible to pray Witr like Maghrib?
The Prophet (peace and blessings of Allah be upon him) did not pray it like Maghrib , with two tashahhuds and one salam. Rather he forbade doing that, and said: “Do not pray Witr with three rak`ahs like Maghrib .” (Narrated by al-Hakim, 1/403; al-Bayhaqi, 3/31; al-Daraqutni, p. 172)
Al-Hafiz ibn Hajar said in Fath al-Bari (4/301): “Its isnad fulfils the conditions of the two Shaykhs (al-Bukhari and Muslim).”
Shaykh Muhammad al-Salih al-‘Uthaymin said:
It is permissible to pray Witr with three rak`ahs, or with five, or with seven, or with nine. If a person prays Witr with three, it may be done in one of two ways, both of which are prescribed in the Shari`ah:
- Praying the three rak'ahs continually with one tashahhud.
- Saying salam after two rak`ahs, then praying one rak`ah on its own.
Both of these are narrated in the Sunnah, so if a person does it one way sometimes and the other way sometimes, that is good.
…It is permissible to say Witr with one salam, but it should be with only one tashahhud and not two, because if he does it with two tashahhuds, it will be like Maghrib prayer , and the Prophet (peace and blessings of Allah be upon him) forbade making it like Maghrib prayer.” (Al-Sharh al-Mumti’, 4/14-16)
And Allah knows best.