If you find my answer helpful, please accept and feel free to leave feedback.
Hello, I see that you've already tried talking to him but I think that you have to be completely open and honest about what you know and how you feel about those things. Relationships should be built on trust and communication and if you can't trust or feel completely comfortable communicating with him then there may always be an issue.
If he truly loves and wants to be with you then he should be willing to do whatever it takes to make that happen. If he's unwilling then this is something that you should take into consideration, how much sneaking and lying are you willing to put up with. It's unfair to you for him to tell you one thing and act opposite of that.
Is there anything I can do to help him overcome his fear of commitment? I feel like the text messages are his way of not getting close to me because he is scared.
Unfortunately, him moving past his commitment issues have to be done by him. You can continue to remain supportive and be there for him but at the same time, don't allow him to use his commitment issues to be untruthful and possibly unfaithful to you.
You can reassure him that you want to be with him and only him but his behaviors may stand in the way of that. You can share with him that you're willing to talk to him about what brought him to this point but that there are things that you won't tolerate such as the dishonesty.