A three-year-old boy has been put in the care of social services after being found alone in a burning house.