Dear Mother,
Constipation (not passing any stool for atleast 7 days) different from passing hard stools. As you told your child is 2yrs Old now, kindly elaborate on the diet he is being given currently. Also make him drink lot of water & liquids. Do not panic & do not use OTC products with out consulting your Peadiatrician.
Next Steps
Plenty of Fluids & Fibre enriched foods
Pediatrician Consultation