Whenever the Messenger of Allah ﷺ bid farewell to a man, he would take his hand and not release it until the man himself let go of the Prophet's ﷺ hand. He would say, "I entrust to Allah your religion, your trust, and the final outcome of your deeds."
حدثنا أحمد بن عبيد الله السليمي البصري حدثنا أبو قتيبة سلم بن قتيبة عن إبراهيم بن عبد الرحمن بن يزيد بن أمية عن نافع
كان رسول الله ﷺ إذا ودع رجلا أخذ بيده فلا يدعها حتى يكون الرجل هو يدع يد النبي ﷺ ويقول استودع الله دينك وأمانتك وآخر عملك
[Its chain of transmission is daif] Ibn Majah also narrated it in the Book of Jihad, Chapter on Seeing Off the Fighters and Bidding Them Farewell, no. 2826, through another route from Nafi, in an abridged form. This hadith has many routes, see Nayl Maqsud, no. 2600, without the words, "He took his hand." See the following hadith, for it is sufficient in place of this one.