Thumamah bin Sharajeel, may Allah have mercy on him, says that once I was present in the service of Sayyiduna Ibn Umar, may Allah be pleased with them both. We asked him about the prayer of a traveler. He said: Its (the traveler's) prayer is two rak‘ahs, except for Maghrib, which remains three rak‘ahs. I asked: If we are in "Dhi al-Mijaz," what is the ruling? He asked: What is "Dhu al-Mijaz"? I said: It is the name of a place where we gather, buy and sell, and spend twenty or twenty-five days there. Sayyiduna Ibn Umar, may Allah be pleased with them both, said: O man, I was in Azerbaijan, and I stayed there for four or two months (I do not remember exactly), and I saw the Companions, may Allah be pleased with them, performing only two rak‘ahs there. Then I saw with my own eyes the Prophet, peace and blessings be upon him, performing two rak‘ahs during travel. Then he recited this verse: "Indeed, in the Messenger of Allah you have a good example."
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 5552