كتاب صلاة المسافرين وقصرها
6  
The Book of Prayer - Travellers
(1)
Chapter: The travelers’ prayer and shortening it
(1)
باب صَلاَةِ الْمُسَافِرِينَ وَقَصْرِهَا ‏‏
Sahih Muslim 687 a

Ibn 'Abbas reported:

Allah has prescribed the prayer through the word of your Prophet (ﷺ) as four rak'ahs when resident, two when travelling, and one when danger is present.
حَدَّثَنَا يَحْيَى بْنُ يَحْيَى، وَسَعِيدُ بْنُ مَنْصُورٍ، وَأَبُو الرَّبِيعِ، وَقُتَيْبَةُ بْنُ سَعِيدٍ، قَالَ يَحْيَى أَخْبَرَنَا وَقَالَ الآخَرُونَ، حَدَّثَنَا أَبُو عَوَانَةَ، عَنْ بُكَيْرِ بْنِ الأَخْنَسِ، عَنْ مُجَاهِدٍ، عَنِ ابْنِ عَبَّاسٍ، قَالَ فَرَضَ اللَّهُ الصَّلاَةَ عَلَى لِسَانِ نَبِيِّكُمْ صلى الله عليه وسلم فِي الْحَضَرِ أَرْبَعًا وَفِي السَّفَرِ رَكْعَتَيْنِ وَفِي الْخَوْفِ رَكْعَةً ‏.‏
Reference : Sahih Muslim 687a
In-book reference : Book 6, Hadith 6
USC-MSA web (English) reference : Book 4, Hadith 1463
  (deprecated numbering scheme)