I miscarried and didn't even now I was pregnant

So about a month ago my boyfriend and I got back together. We'd been apart 5 months and took a month or so to talk about trying again and sort through things. We're long distance right now and aren't going to see eachother until May. When I saw him a little over a month ago we had sex without a condom (I'm on the pill and we both have no STIs). His control isn't what is was before our break up and he pulled out a bit late. We didn't worry since I'm on the pill and take it like clock work. A few days ago I collapsed in class and was taken to the ER. I found out I was having a miscarriage. 
We've been through a lot and both of us are being fairly cautious about starting again. I don't really know how to tell him because even though a baby would not be good right now I'm devastated at the same time I'm kind of glad (I feel horrible that I feel this way) because I'd never be able to have an abortion and this way I don't have to deal with a pregnancy/baby. I don't know how to explain that to him. I don't want to lose him again- that was the worst time of my life without him. And I'm so afraid of telling him. He's amazing and deep down I know he'll try to understand and he'd never be mean to me about this. But I don't even know where to start. Any advice would be very appreciated. Thank you!