Saad bin Abu Waqqas reported,

The Messenger of Allah ﷺ set out for Tabuk and appointed Ali as his deputy in Madinah.Ali said, "Are you leaving me behind with the children and the women?"The Prophet ﷺ replied, "Are you not content to be in relation to me as Harun was to Musa, except that there is no prophet after me?"

Azami 9257

Sahih

عن سعد بن أبي وقاص قال

إن رسول الله ﷺ خرج إلى تبوك، واستخلف عليا فقال: أتخلفني في الصبيان والنساء؟ قال: ألا ترضى أن تكون مني بمنزلة هارون من موسى، إلا أنه ليس نبي بعدي.

الأعظمي 9257صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Biography of the Prophet ﷺ
Chapter
Expedition of Tabuk, which was in the year nine without disagreement
Section
Ali being appointed as deputy over Madinah
Numbering
Jami al-Kamil 9257 (2nd edition)
Azami 9257