How do you train a new puppy to go to the bathroom outside?

i have a new puppy tank and sometimes he goes to the door and scratches but most of the time he just pees and poops in the floor...how do i keep him from going in the house???
Update: i have a new puppy named tank he is pitbull bulldog and boxer....for all those he likes to play but doesnt take it out of control....he sometimes goes to the door and most of the time he will just pee....i put him in his kennel if he goes and put his face in his pee and spank him or hit him watever you want to... show more i have a new puppy named tank he is pitbull bulldog and boxer....for all those he likes to play but doesnt take it out of control....he sometimes goes to the door and most of the time he will just pee....i put him in his kennel if he goes and put his face in his pee and spank him or hit him watever you want to say.....what am i suposed to do ....i need to know from thje rest of you...how do i train him???
7 answers 7