My Dog Attacks Me When I Punish Him, What Should I Do?(extra Details For My Last Question)?

i have a two year old cockapoo and he attacks me when i punish him. he is a dominant male that is fixed. he has a potty training problem, ive worked with him since he was eight weeks old and he is still not housebroken. he is crate trained. i correct him by either smacking him on the butt or yelling at him(verbal commands, bad dog ect.) i havent let him get away with much without a punishment. he attacks any dog in sight and doesnt like little children. his attacking has gotten soo bad that i took him back to the breeder for advice. she told me when he attacks me i should grab him by the scruff and put him on his back until he calms down. ive tried this but after he calms down and i let go he attacks me again. he can be a nice dog sometimes. ive taken him to the vet and there are no health causes. please help!!!

My Dog Attacks Me When I Punish Him, What Should I Do?

i have a two year old cockapoo(cockerspaniel + poodle) and he is a dominant male that is fixed. he has a potty training problem and every time i try to correct him when he goes in the house, he attacks me. he is crate trained. he also attacks any other dogs in sight and cant get along with my cat. he also cant stand little kids that like to play. there are a lot of little kids in my neighborhood and i dont want him to attack any more dogs or any little kids and have myself sewed. please help me!!!!