Ali bin Zayd narrates from Abu Nadrah that a man asked Sayyiduna Imran bin Husayn (may Allah be pleased with him) about the prayer of the Prophet (peace and blessings be upon him) on journeys. He said: "Come to our gathering." Then he said: "This man has asked about the prayer of the Prophet (peace and blessings be upon him) on journeys, so you too learn it from me. Whenever the Prophet (peace and blessings be upon him) travelled, he would pray two rak'ahs each until he returned, and he would say: 'O people of Makkah! Stand and pray two (more) rak'ahs, for we are travellers.' He went on the expeditions of Ta'if and Hunayn and prayed two rak'ahs, and he came to al-Ji'ranah and performed Umrah from there. I performed Hajj and Umrah with Sayyiduna Abu Bakr (may Allah be pleased with him), and he used to pray two rak'ahs. Sayyiduna Umar bin al-Khattab and Sayyiduna Uthman (may Allah be pleased with them both) also used to pray two rak'ahs at the beginning of their caliphate; then Sayyiduna Uthman (may Allah be pleased with him) began praying four rak'ahs at Mina."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 5484