Babies don’t need pillows to sleep with. The only time it may be useful for a baby to sleep with a pillow is if they have a very flat/asymmetric back of the head. In that case a very small flat baby pillow can be helpful to soften the lie on the flat bit and minimize the resulting compression of the head that tends to aggravate the existing restriction pattern.
This is really only an issue until they are about 5mths old, when they start to role over by themselves. At that stage they will tend not to sleep on their back and they will naturally role off the flat bit. If you do look into using a baby pillow to help with a flat head, you need to consider the increased risk of sudden infant death syndrome (SIDS) associated with using blankets or pillows for children under the age of 12 months, and make a decision that you feel comfortable with. You could alternatively look at ways in which you could soften the lie of the head before 5 months of age without the use of a pillow (e.g. some people like to use sheepskins especially prepared for babies to lie on), or perhaps having the pillow underneath the mattress cover would help (to fix it in place)?
There are also other things you can do to help the flat head like lying the baby so that any stimulation is on the opposite side to the flat head; like that you will encourage your baby to actively role off the flat bit to look at you, or the light coming from the window, or the sound of your voice, etc… And of course in clinic we find the flat head is commonly associated with underlying restriction patterns from birth trauma or in utero lie, so if you haven’t done so already take the baby/child in to be looked at by your osteopath.
After babies start to role over by themselves (at 5mths or later), they wont need to use a pillow (and it will just get in the way) until a good few years later when their shoulders broaden and their body catches up with the relative size of the head- so keep an eye on them and when you see their head dropping down towards the mattress because of the size of their shoulders, that is the time to get them an appropriately sized pillow (use the diagram below to assess when they need a pillow and what size it needs to be). By this stage children can usually understand the reasoning behind why they might need a pillow, and my experience is that it is good to explain it to them (in a child like/playful way) so that they get into good habits early on- otherwise they don’t always have a good sense of where their heads should be on the pillow and it can easily end up half way down their shoulders which is not helpful.