Hi, I'd suggest speaking to a naturopath or gp, as it might be something to do with the Zantac killing intestinal flora in his belly. My daughter is 7 months but when she was 6 weeks we gave her Nilstad to clear up thrush on her bottom, thankfully it worked but as soon as I started her on solids she would also scream and cry when trying to poo, it would break my heart everytime as there was nothing I could do to help her. Eventually I spoke to a naturopath who advised that the Nilstad kills intestinal flora and makes it hard to poo, so I now give her acidopholous powder and yoghurt as well as lots of water & watermelon. Its made a massive difference and she no longer cries. I know this may not be that helpful given your baby is so young, but there might be something you can take (eg acidopholous tablets) that might then pass through your breast milk to your little one.
Goodluck
EJ