A man came to the Prophet ﷺ while he was delivering the sermon and asked him how to offer the night prayers. The Prophet ﷺ replied, 'Pray two rakʿat at a time and then two and then two and so on and if you are afraid of dawn (the approach of the time of the Fajr prayer) pray one rakʿa and that will be the witr for all the rakʿat which you have prayed." Narrated 'Ubaidullah bin ʿAbdullah bin ʿUmar: A man called the Prophet ﷺ while he was in the mosque.
أَنَّ رَجُلاً جَاءَ إِلَى النَّبِيِّ ﷺ وَهْوَ يَخْطُبُ فَقَالَ كَيْفَ صَلاَةُ اللَّيْلِ فَقَالَ مَثْنَى مَثْنَى فَإِذَا خَشِيتَ الصُّبْحَ فَأَوْتِرْ بِوَاحِدَةٍ تُوتِرُ لَكَ مَا قَدْ صَلَّيْتَ قَالَ الْوَلِيدُ بْنُ كَثِيرٍ حَدَّثَنِي عُبَيْدُ اللَّهِ بْنُ عَبْدِ اللَّهِ أَنَّ ابْنَ عُمَرَ حَدَّثَهُمْ أَنَّ رَجُلاً نَادَى النَّبِيَّ ﷺ وَهُوَ فِي الْمَسْجِدِ