Sunan Ibn Majah, Volume 2, Book 5, Hadith 1075 (DarusSalam) ⓘ
It was narrated that Ibn ‘Abbas said: “The Messenger of Allah stayed for nineteen days in which he shortened his prayer to two Rak’ah. So, whenever we stayed for nineteen days we would shorten our prayer to two Rak’ah, but if we stayed more than that we would pray four Rak’ah.”
حَدَّثَنَا مُحَمَّدُ بْنُ عَبْدِ الْمَلِكِ بْنِ أَبِي الشَّوَارِبِ، حَدَّثَنَا عَبْدُ الْوَاحِدِ بْنُ زِيَادٍ، حَدَّثَنَا عَاصِمٌ الأَحْوَلُ، عَنْ عِكْرِمَةَ، عَنِ ابْنِ عَبَّاسٍ، قَالَ أَقَامَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ تِسْعَةَ عَشَرَ يَوْمًا يُصَلِّي رَكْعَتَيْنِ رَكْعَتَيْنِ فَنَحْنُ إِذَا أَقَمْنَا تِسْعَةَ عَشَرَ يَوْمًا نُصَلِّي رَكْعَتَيْنِ رَكْعَتَيْنِ فَإِذَا أَقَمْنَا أَكْثَرَ مِنْ ذَلِكَ صَلَّيْنَا أَرْبَعًا .
also referenced under: Hadith 1075 (Reference) & Book 5, Hadith 1128 (In-Book)