Allah has prescribed the prayer by the tongue of your Apostle ﷺ as two rak'ahs for the traveller, four for the resident, and one in danger.
إِنَّ اللَّهَ فَرَضَ الصَّلاَةَ عَلَى لِسَانِ نَبِيِّكُمْ ﷺ عَلَى الْمُسَافِرِ رَكْعَتَيْنِ وَعَلَى الْمُقِيمِ أَرْبَعًا وَفِي الْخَوْفِ رَكْعَةً