I get the joke, but to throw a monkey wrench into the punchline....
There are a few scenarios that could happen.
1) The soldier came back on leave at some point during his deployment. There is leave while abroad and the soldiers have the ability to come home for about a week or two.
2) Most soldiers, if not all, don't have three year deployments, but that's not really an issue for this joke.
3) His wife was getting the bottom knocked out of her ass while he was deployed. lol!
But I'm guessing number 1 was probably more likely.