I'm assuming you're using disposables. My baby managed to wiggle out of her diaper at 3 months. So, first, make sure that the diaper is secured and that the little tabs on the sides overlap each other properly at the hip. Take it from me, this is a surprisingly important detail.
Each brand of diaper is going to fit a little differently than others. It could be you need to use a different brand.
I change my baby very frequently so the only time I've run into leaks is overnight when the diaper is just overly full. My baby still wakes up during the night (unfortunately) so I just make a point of changing her every time she wakes up, even if she's groggy and half-asleep or cranky and doesn't want the change.
If she leaks at all during the day, it tells me that I need to go up a size. Leaking out the top is an indicator of this--the "rise" of the diaper may not be high enough. This can even be the case for a newborn; diapers are sized in part based on the weight of the baby, and newborn diapers typically only seem to go up to 8-10 pounds. Even if your baby was 8 pounds at birth, it's possible that he's grown out of newborn diapers already.
I'd suggest trying a few store brands; my baby does quite well on generics (better than brand-name diapers; those burned her bottom and gave her allergic rash). They're a cheap way of experimenting with what diapers fit best and what ones don't.