Per our Pediatrician, feed on demand for the first year. For the first year of life, a baby's primary source of nutrition is from breastmilk/formula.
BUT, you might want to consider that your baby is perhaps going through a growth spurt, and they DO need more intake, and they are changing developmentally, and this combined wakes them.
Also, when your baby wakes, you don't necessarily have to go and pick him up. Just wait... hang loose, then see if he will settle back down himself. MANY times, a baby just makes noises while they sleep, but they are NOT fully awake... it is just interruptions in REM sleep. So, just wait. Many times my kids did this too. But they settled back down.
Also, he may be teething. That is another reason why they wake so much many times.
For me personally, 5 months is young and to be denied a feeding IF this is what he needs.
At this time of age as well, they also get more aware and 'separation anxiety' can develop... and yes, they wake more wanting to know where you are. I went through this with both my kids as well... and our Pediatrician said that about 6 months old, this can crop up. But it is also a time of great changes in a baby, and she sees this all the time, with the babies waking more. It's just something to ride out.
The main thing, no matter what method you do... it has to be consistent AND age appropriate.
He is still so young... and this is how it is. I have gone through these phases with BOTH my children too. But, it passes. But other sleep phases develop as well, ALL throughout childhood.
Do you know for SURE that he is not hungry? Because at about this age or so, they go through a growth spurt. About every 3 months is a growth spurt, and intake needs increases.
On the other hand, I had several friends that went through this too. And essentially, their baby was not getting enough intake... the Mom was not producing enough milk... so the baby was always waking due to hunger and not being satisfied.
What are you currently doing, when he wakes? Do you try and feed him? Pat him? Rock him? Just let him be and see if he settles back down again?
Even if it is a "habit" now that he wakes every 2 hours.. it will change. Sleep patterns ALWAYS change in a baby. So keep that in mind.
I know it's not easy... but it will pass.
All the best,
Susan