The Torah specifies three types of people who are exempt from going out to war: one who built a house but did not dedicate it, planted a vineyard but did not harvest its fruit, or betrothed a woman but did not yet take her to wife (Deut. 20:5-7). All three are told to “return home.” On a deeper level, these three categories refer to the three stages of end-times. One’s “house” is one’s portion in the World to Come, which one builds during one’s lifetime for an abode in the hereafter. One’s “wife” refers to the coming of Mashiach (Messiah), at which time Israel will be restored before G-d as a wife to her husband. The “vineyard” represents the Resurrection of the Dead, when the righteous will live again immortally before G-d, like wine, a substance that rather than spoil over time, only improves with age. Anyone who lacks the necessary merit to deserve any of these elements of end-time is instructed by the Torah to “return,” that is, to do teshuvah (repentance), to return to Hashem.
Source: Shla”h, Parshas Shof’tim