Maybe he feels bad about the hurt this separation will cause you two. Him being the one that’s moving away may make it feel like it’s largely his fault. You two spending even more time together just increases the hurt that it will bring (maybe in his mindset). He might be trying to gradually pull away while he’s still geographically near rather than look forward to a possibly tearful goodbye on zero day.
I second the motion to write him a letter telling him how you feel about your friendship and your closeness. It may help him think through his own hurt feelings and it’s something that he can take with him when he leaves to remind him of the good friend he’s got in your town.
If he wants space, give it to him. A good friend would do that. Conversely, if you’ve told him how you feel and you want these last few months to be as close as ever with him, he may oblige (being a good friend) and put his feelings aside. The best thing that could come out of that is an open discussion about how you both want your friendship to be after he leaves. I think that would be a big relief on both of your minds.