What am I doing wrong?

Matilda

I’m a first time mom and just had my son a week ago. The past couple days I’ve realized he’ll pee or poop out of his diaper. Idk if I’m not putting in on right or maybe I’m using the wrong size for him? I always pull out the sides around his butt, but still he will leak poop out the sides. Also sometimes when I change him I’ll notice the line where the diaper goes around his legs is red like it’s too tight. But sometimes he’ll get pee up his sides! So I feel like that means itd be too big. I just want my little man to be comfortable ☹️. I usually change him every time he eats, about every 1-3 hrs. Idk if it helps but he was 8 lbs 12 oz and 21.5 inches at birth.