Whenever the Prophet ﷺ returned from a military expedition, a Hajj, or an Umra and ascended a high ground or hill, he would say "Allahu Akbar" three times, then say, "There is no god but Allah alone, with no partner. To Him belongs the dominion and to Him belongs all praise, and He has power over all things. We return repentant, worshipping, prostrating, and praising our Lord. Allah has fulfilled His promise, given victory to His servant, and defeated the confederates alone."
حدثنا علي بن حجر أخبرنا إسمعيل بن إبراهيم عن أيوب عن نافع
كان النبي ﷺ إذا قفل من غزوة أو حج أو عمرة فعلا فدفدا من الأرض أو شرفا كبر ثلاثا ثم قال لا إله إلا الله وحده لا شريك له له الملك وله الحمد وهو على كل شيء قدير آيبون تائبون عابدون سائحون لربنا حامدون صدق الله وعده ونصر عبده وهزم الأحزاب وحده
Sourcing, agreed upon by Bukhari and Muslim. Muslim reported it in the Book of Hajj, chapter on what one says when returning from a journey of Hajj or otherwise, no. 1344, from the hadith of Ismail, who is Ibn Ulaya. Bukhari, no. 1797, from the hadith of Nafi, with the same wording.On this topic there are also narrations from Bara [to come at 3440], Anas [Bukhari, no. 3085, and Muslim, no. 1345], and Jabir [Bukhari, no. 2993].