Allah prescribed the prayer as four units when settled, two units while traveling, and one unit during fear, through the tongue of His Prophet ﷺ.
حدثنا وكيع حدثنا أبو عوانة عن بكير بن الأخنس عن مجاهد
فرض الله عز وجل صلاة الحضر أربعا وفي السفر ركعتين والخوف ركعة على لسان نبيه ﷺ