If I stand up and rock him that settles him better but should I be worried about forming bad habits?
Yes. There are gentle routes to wean off this though, if you are careful about it. The added "rod for your back" of rocking in your arms is that you're weaning off physical closeness to you as a comfort mechanism, as well as movement. That's why I suggested naps in something that moves (bouncy chair for example) - easier to wean off.
Or once this phase is over will he go back to liking his cot again? As I say he always went to sleep in his cot so I don’t know what has changed!
That is a big answer. I'll do my best to condense it for you.
At around 14 weeks (after the fourth trimester ends) baby's sleep changes very significantly, and permanently. Through the fourth trimester baby's sleep is womb-like. By that it means that as long as all needs are met, baby's passive state is to be asleep. So this is exemplified by the fact that baby just wakes if hungry, and uncomfortable (nappy change, in pain etc) and as long as these needs are met baby will be asleep.
At around 3-4 months (it's called the 4 month sleep regression) sleep changes in a permanent way, it will never go back to being passive as it was previous to this.
Sleep is now an active endeavour. It takes work to get to sleep and work to stay asleep. Sleep develops into cycles of light sleep and deep sleep - meaning that babies have to learn from scratch how to resettle back into a deep sleep. Again, this is active and needs work.
Until baby has the physical ability to control their limbs and thoughts in such a way to self-sooth, the soothing is facilitated by the parent. Then over time baby (hopefully) learns to do the soothing without help.
The dummy is the simplest no-tears self-soothing tool. I'd suggest you keep it's use consistently.