The Messenger of Allah ﷺ used to pray thirteen rakahs during the night, performing witr with five, not sitting except in the fifth, then giving the salam.
حدثنا يحيى عن هشام قال حدثني أبي
أن رسول الله ﷺ كان يصلي من الليل ثلاث عشرة ركعة يوتر بخمس لا يجلس إلا في الخامسة فيسلم
Its isnad is sahih. Bukhari narrated it with a different wording, 3/20, no. 1139, in tahajjud, Muslim, 1/508, no. 737, in "Travelers," Abu Dawud in "Prayer," 2/39, no. 1338, and Tirmidhi, 2/175, no. 416, in Witr, and he said, hasan sahih. Nasai, 3/252, no. 1759, and Ibn Khuzayma, 2/160, no. 1107.