Advice please

I posted earlier today but I guess I didn't ask my question very well. 
My boyfriend and I are in an LDR. We broke up when I moved away because we thought it would be better, but later decided that we both didn't want to move on. So our relationship has been a little rocky since we're still trying to figure things out with the whole LDR/getting back together thing. We saw eachother a month ago and had sex without a condom (we were together a year before that and are both STI free). I'm on the pill so we didn't think anything of it when he didn't manage to pull out in time. I sometimes skip a period due to the pill so I just ignored the missed period two weeks ago. Yesterday I ended up in the ER due to collapsing over a miscarriage. I had no idea I was pregnant. 
I feel awful about losing a baby, but at the same time I'm relieved because I could never abort and my boyfriend and I are not ready for kids at all. I feel even worse about the whole thing for feeling relieved too. I really don't know how to tell my boyfriend. We've never had a scare before and now we're recently back together and long distance. I don't see him till May so I'll have to tell him over the phone which makes it worse. Does anyone have any advice? For dealing with this/how to tell my boyfriend? I just feel sick over the whole thing and any advice would be really really appreciated. Thank you