All perfect praise be to Allah, The Lord of the Worlds. I testify that none is worthy of worship except Allah and that Muhammad is His slave and messenger.
The Hadeeth that you mentioned is not authentic. It was reported by Al-Bayhaqi in Az-Zuhd Al-Kabeer, and narrated by Jaabir who said that some people came back from fighting and the Prophet, sallallaahu 'alayhi wa sallam, said to them: “You have come back from the minor Jihaad to the greatest Jihaad.” The people around him asked: “What is the greatest Jihaad? He replied: “The slave struggling against his own desires.” Then Al-Bayhaqi commented on this Hadeeth saying: “This Hadeeth has a weak chain of narrators.”
Shaykh Ibn Taymiyyah, may Allaah have mercy upon, said: “As for the Hadeeth narrated by some people that the Prophet said after the Battle of Tabook: 'We have returned from the minor Jihaad to the greatest Jihaad.'; then it has no foundation and none who is knowledgeable about the sayings and actions of the Prophet has narrated it.” [End of quote]
Those who can read Arabic language may refer to As-Silsilah Adh-Dha’eefah by Shaykh Al-Albaani for more details on the different narrations of the Hadeeth (no 2460).
Allah Knows best.