Hi Mandy! Hope you don't mind a post from an "old" navy wife. My dh has been retired since '89 but when it comes to sea duty and shore duty, nothing has changed in the Navy that way.
I actually didn't really change eating habits much when he was gone versus home, but since it is obviously something you struggle with maybe I can suggest some things.
For one thing, you have set your mind around this home not home thing. That sets you up for failure right there. Quit gauging whether you eat properly or not on whether he is home or not. You are allowing yourself the habit of blaming sea duty for gaining weight. In other words, you have already convinced yourself you are going to screw up when he leaves. Instead of focusing on the food, focus on why you start gobbling food when he leaves. Is it truly because you really miss him, is it that you no longer have someone around that can see what you are eating when he is home so you feel sort of like "yippee all bets are off." (I am not saying he says anything, I am saying these are perceptions in your brain) Are you replacing the junky food for your husband's presence as comfort, etc? Look seriously at the reason you start bulking up on junk stuff when he leaves.
I would then make a plan ahead of time, before he leaves on what steps you are going to take to keep eating properly. Remember you have children in the house and they need it as much as you do. Taking them to kids night at restaurants only encourages them to eat fatty food like hot dogs, chicken nuggets and the like too. The time to instill good habits in children is when they are young not after the problem is concrete in their brains. In this way, you have a common goal with your children.
Promise yourself you are going to find and start a new hobby or job on his deployment that requires you to use your hands. Learning to knit, crochet, paint, sculpt, even sprucing up your home or Navy quarters requires you to keep mind and hands busy.
Finally, if nothing else, replace at least one junk food for one good one. Make a pact with yourself that on the next deployment pizza is a nono, or no sitting in front of the tv with a carton of ice cream.
Hope this helps and you get to goal and stick there. It isn't easy that's for sure. As I always tell everyone, eating properly is the hardest addiction to permanently stick with. If you are a drug, cigarette, alcohol or even gambling abuser, you have to go to it or go get it and bring it into your home to over use. You always have food in the house and you can over eat even good stuff. Good luck to you and you can always pm me at any time!