Giving him space.

I am giving my boyfriend space. I don't know if its the right thing to do. Hes going through a hard time but he's been treating me so badly for almost 2 weeks now. Its been 5 hours and I just miss him and I'm sad. I have messed up my back so pretty much being on my phone or sleeping is the only thing I can do until it heals. When I told him he said he didn't want to be without me and of course I don't want to be without him, but he won't tell me whats going on and most importantly how to help him. All of this is having a effect on me too and he realizes that, but all he ever says is "I'm sorry". I just want to stop worrying and I want to help him more than anything, but all I can do is wait. Was is right of me to do that? Should I text him and ask if he's doing okay? What can I do to distract myself from being so down?