The Prophet ﷺ was asked about the night prayer. He said, "It is to be prayed two by two, and when one fears the approach of dawn, he should pray a single rakah as witr."
حدثنا سهل بن أبي سهل حدثنا سفيان عن الزهري عن سالم عن أبيه وعن عبد الله بن دينار عن ابن عمر وعن ابن أبي لبيد عن أبي سلمة عن ابن عمر وعن عمرو بن دينار عن طاوس
سئل النبي ﷺ عن صلاة الليل فقال يصلي مثنى مثنى فإذا خاف الصبح أوتر بواحدة
Bukhari narrated it in the book of tahajjud, chapter "How did the Prophet pray, and how many rakats did the Prophet pray at night?", hadith nos. 1137 and 990, from the hadith of Abdullah bin Dinar, and from the hadith of Zuhri, from Salim, from his father, with the same wording.The hadith of Tawus was narrated by Muslim in the book of the prayer of travelers, chapter "The night prayer is two by two, and Witr is one rakat at the end of the night," hadith no. 749A, and from the hadith of Sufyan, with the same wording.The hadith of Abu Salama was narrated by Nasai, 3/227, hadith no. 1669.