Infant constipation is not very common. However, your baby might have infant constipation if he or she has: hard or pellet-like bowel movements, bowel movements that appear difficult to pass, causing your baby to arch his or her back or cry. If your newborn seems constipated, contact his or her doctor for advice. But keep in mind that the normal amount of bowel movements an infant passes varies depending on his or her age and what he or she is eating. Infants also have weak abdominal muscles and often strain during bowel movements.
Source
Causes
Although it's rare for a baby on an all-liquid diet to experience constipation, it can happen. Exclusively formula-fed babies are much more likely to have trouble from constipation. Formula can firm up poop much more than breast milk can. If your baby has a milk-protein allergy or intolerance, she could end up constipated. A milk-based formula could cause this, as well as the dairy in mom's diet that's passed through the breast milk. This also carries over to any other kinds of dairy an older baby could consume, such as yogurt and cheese.
When a baby is around 6 months, pediatricians often give parents the green light to offer a variety of baby food. What your baby eats will largely determine the kind of poop you can expect. And many different foods could contribute to constipation. Start by considering your ABCs -- applesauce, bananas, and cereal. Too much of any of these, especially rice cereal, can get you into trouble.