A man asked the Messenger of Allah ﷺ about the night prayer. He replied, "It is to be prayed two by two, and when you fear the approach of dawn, pray a single rakah."
أخبرنا محمد بن قدامة قال حدثنا جرير عن منصور عن حبيب عن طاوس قال
سأل رجل رسول الله ﷺ عن صلاة الليل فقال مثنى مثنى فإذا خشيت الصبح فواحدة
Muslim narrated it in the Book of the Prayer of the Traveler, Chapter on the Night Prayer Being Two by Two, and the Witr Being One Rakat at the End of the Night, hadith 146/749, from the hadith of Tawus, and Ahmad, 2/141, from Jareer bin Abdul-Hameed with the same chain.Habib is Ibn Abu Thabit, and Mansur is Ibn Mutamir.