I feel your pain it's torture isn't it?
I have 4 DC, nos 2,3 and 4 were all like this so you are not alone. It is normal for a 5 month old to wake every 2-3 hours for milk. DS woke like this right up until 11 months old sorry not what you want to hear.
At 5 months old I would argue that they do still need milk every 2-3 hours, some don't but some do and I don't agree with limiting milk feeds even at night for a baby this age.
IME weaning does absolutely NOTHING to help a baby who does not sleep through sleep any better.
What I have done with the last 3 is at 11-12 months when I know they are eating 3 meals a day and having snacks is night weaning them, completely different to CC in that they are never left to cry but instead Dad goes to comfort them and I stay completely out the picture (slept in another room for a week) they seem to realise that if they aren't getting a boob there's no point in waking up. DS has been sleeping through for 3 weeks now (touch wood), it was very easy to get him sleeping through in his own cot after 11 months of cosleeping and BFing at night.
There probably will be others who come on and say weaning helped or that they tried some sort of sleep training and that worked too which is great for them. I wouldn't have done it with a baby so young though.
What you can do is try to minimise the disruption to you, that could be trying to give a bottle of EBM last feed at night so your DH could do a feed to give you a longer stretch of sleep, cosleeping so you literally are just latching on and falling back asleep or if you are very lucky catching up on some sleep during the day. I coslept so kind of jsut got used to latching on and falling back asleep, each time I was probably awake less than a nighttime loo trip IYSWIM?
IT will get better though