‘Abdullāh ibn ‘Umar (may Allah be pleased with him) reported: Whenever the Messenger of Allah (may Allah's peace and blessings be upon him) mounted his camel while setting out on a journey, he would say Takbīr three times and then say: "Glory be to the One who subdued this (ride) for us and we were not ourselves powerful enough to use it as a ride, and to our Lord we shall, indeed, return. O Allah, we ask You during this journey of ours for righteousness, piety, and such deeds that are pleasing to You. O Allah, make easy for us this journey of ours and make the distance short for us. O Allah, You are the Companion during the journey and the Guardian of the family and the property in our absence. O Allah, I seek refuge in You from the hardships of traveling, unhappiness connected with ghastly scenes, and the evil turns in property and family." On returning, he would recite this supplication, while adding these words: "We are those who return; those who repent; those who worship; and those who praise our Lord."
In another narration: “Whenever the Prophet (may Allah's peace and blessings be upon him) returned from Hajj or ‘Umrah and ascended a height or hill, he would say Takbīr three times and say: there is no god but Allah, who has no partner; to Him belongs the sovereignty and due to Him is all praise; and He is omnipotent over all things. We are those who return; those who repent; those who worship; those who prostrate; and those who praise our Lord. Allah has fulfilled His promise, granted His slave victory, and vanquished the confederates alone."
In a different wording: “Whenever he returned from battles, Hajj or ‘Umrah.”
Authentic hadith -
Narrated by Muslim