Abdullah bin Abbas reported,

Allah made the prayer obligatory through the tongue of your Prophet ﷺ as four units when residing and two units when traveling.

Ibn Majah 1068

Sahih

حدثنا محمد بن عبد الملك بن أبي الشوارب وجبارة بن المغلس قالا حدثنا أبو عوانة عن بكير بن الأخنس عن مجاهد

عن ابن عباس قال

افترض الله الصلاة على لسان نبيكم ﷺ في الحضر أربعا وفي السفر ركعتين

ابن ماجه 1068صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Establishing prayer and the sunnah regarding it
Chapter
Shortening prayer during travel
Numbering
Darussalam 1068
Ibn Majah 1068