An East Lothian man has been jailed after being found guilty for a series of assaults at a residential home for children.