He's not having accidents, he just hasn't got the idea of housetraining yet, you can't be letting him run around without watching him like a hawk. If you can't, he's gotta be in his crate. Take him out regularly, make a big fuss, treats, when he pees/poos where you want him to. If he does nothing, he has to go back in the crate if you can't watch him. Be consistent, he'll learn.