This was exactly the case with me. Just know that he is probably using you to boost his self confidence, because he knows you are always there, you will always listen. He knows that you like him and it makes him feel really good about himself.
When he's not responding to you, or only responds with 1-2 words, rest assured he is busy talking to another woman/man.
You are worth so much more than to be someone's toy that he can go back to when he's bored or when he needs love and attention.
And one important thing: You. Cannot. Change. Him. No. Matter. What. Your love will NOT change him, ever.
When you feel sad about him not responding, just imagine him texting happily with someone else. And when he is seeing your text, he goes "ohgod not her again..."
The more energy you put into him, the more you push him away. If he wants you, he will move mountains to be with you. Everything else is just bullshit, especially if it's a pattern what he is doing. Everyone has bad days, but if he is doing this push-pull shit all the time, please RUN. RUN, and never look back, your heart is going to break into millions of pieces.
Take back your focus and attention to yourself, do not feed his confidence anymore.
It's going to hurt like hell, and you are going to feel like you are withdrawing from a heavy drug.
And this is also really important: you are going to hear lots of times that "if you don't pay attention to him, he will come back".
Please DON'T listen to this, DO NOT keep the hope that he will change if you pull back. It might be the case, but don't keep hoping, do your best to not give a damn about him anymore. If he comes back and decides that he wants you in his life, good, but there is a high chance that it's not the case.
I did this too, I pulled back in hopes that he will want me, and oh.. he never reached out to me again. Just be prepared for this.
You most likely learned in your childhood that love is not unconditional, that you have to do things in order to receive love. I don't want to say stupid things, i might be completely wrong, but maybe he reminds you of your father in a way, or you just crave the attention that he gaves you from time to time.
Don't blame yourself please, you are not bad for wanting to be loved and wanting to give love. But it is way better to be alone than to be in this push-pull dynamic, this is eating your soul and you slowly start losing your mind...
I'm sorrry, and i'm sending you many hugs

You got this.