You should never place a baby on top of a pillow to sleep if they're under 1 and 1/2 years old.
Babies who are not 1 year and 6 months old can suffocate if they turn over onto the pillow and cannot breathe.
Never place a pillow in the crib, playpen or bassinet or anywhere else the baby is sleeping until they're at least 1 year old.
But always keep the baby sleeping on a firm flat surface until they're at least 1 year old but it's better to keep them on the firm surface until 1 year and 6 months to be safe.
Once the child reaches 1 year and 6 months then you can safely use a pillow for the toddler but until them keep, blankets, pillows and other soft objects away from the baby when they're sleeping to prevent SIDS "sudden Infant Death Syndrome.
You can keep the baby warm using footed pajamas instead of a blanket and they're just fine without using a pillow until they're 1 year and 6 months of age.