Unless you enjoy rocking your baby so much that you want to do it several times a night, you may wish, by the time your child is five or six months old, to alter the way you put him to bed in the first place. You need not deny yourself the joy of rocking him, but rock him when he is wakeful. That way your baby gets a bonus: he is fully aware of the pleasure of snuggling in your arms. When it is bedtime, put him into his crib in his favourite sleeping position, tuck him in, and kiss him good night and turn off the lights, perhaps leaving a night light on. Leave the room so he will get used to falling asleep alone. If he protests, you can pick him up and cuddle him, or do some quiet chore such as sorting his laundry.
Or you can leave the door open and give evidence of your presence just outside his room by talking and making soft other soft noises as you move about. In some cases a few evenings of this routine is sufficient for your baby to learn how to go to sleep on his own and he will apply that experience whenever he awakens in the middle of the night but if your child reaches the age of five or six months and is still demanding your attention throughout the night, you may wish to try the special sleep training program devised by some pediatrician specializing in sleep problems.