There are loads of different ways to go about teaching baby to sleep in the cot. Some are harsh and fast, some are slow and gentle, and everything in between. But all the ways you could look at to improve baby's sleep all come down to the same thing - get baby to go to sleep where they will stay asleep, and don't move them once asleep.
The gentlest option would be to abandon the cot. Cuddle baby to sleep lying on your bed and leave him there.
The next most gentle option would be to think about a journey towards independant sleep in the cot, but that this will be very gradual over many months. For example slow down your rocking until after a few weeks you're just cuddling to sleep. Then iver time put baby down at infinitesimally less states of being fully asleep. Start with cuddling for 30 mins after falling asleep before putting down. A week later cuddle for 28 minutes. Then 25 and so on, until putting down just as going to sleep and doing in-cot cuddling for the rest of the 30 mins. Then put down a few mins before fully asleep for in-cot cuddling, and so on.
There are then various ways to do the same as above, but at a faster pace. This will involve more tears and distress, but get to the end point faster. For example start off with baby in the cot awake. Baby will cry. Lots of bending into the cot to comfort. Consider a sidecar cot. Hand on baby's chest helps for reassurance. Stay calm. Stay compassionate. Stay through all the crying and keep caring. Then over time baby will get more used to going to sleep in the cot and gradually you reduce the input you need to give.
Another option is called Pick up Put Down. It is similar to above but after set periods of time (say every 5-10 mins of in-cot settling) you pick baby up for a cuddle to calm (but not sleep). Then put back down and start again. Thus helps for people who thrive on predictable routines - I do 1 min of cuddling I'm the cot, 1 min of hand in chest and face close to baby's, 2 min if patting and shushing, then pick up for 39 sec. Then start again. Some babies get frustrated by being picked up though, and it breaks the flow of going to sleep.
The harshest of options is called controlled crying. You put baby in cot with minimal fuss, leave for a set amount of time (say 1-3 mins), return, check baby is safe, brief reassure and leave again. Repeat until asleep.