It took my DS a good 6 months (maybe even a bit longer) before he stopped having poo issues - from day 1 he had poo issues, he'd scream, strain, cry, and as soon as he'd done it he'd settle, it was v clear his discomfort was linked to that. He was EBF too.
I raised it with the HV, and the GP, they said colic, pushed further and eventually managed to get to see a paediatrician who recommended going dairy-free in case it was CMPA. I didn't notice a big difference off dairy but I think that was because by the time I cut it out he seemed to be getting better anyway, in hindsight I should've done that earlier.
Things I tried that helped: baby massage (the specific one for colic, will try and find links), jiggling him up and down, and my secret weapon was "the car" - I'd lie on my back with my knees up, sit him on my lap facing me and leaning against my knees, and jiggle around while playing the car noise from the Sound Sleeper app (best app ever
) Seemed to soothe him and maybe the jiggling helped get things moving.
Anyway as others have said def take baby to GP, but there are things you can try in the meantime to ease the discomfort