How do YOU deal with ur disobedient toddler?!

Mary • 27, from Utah, I have one 2 yr old son and a baby on the way!
Ok we all know how annoying it is when ur at the store & u see some bratty kid mouthing off or throwing a fit to his mother & she just sits there. Before i had kids I'd always think to myself "spank the heck outta ur kid before I do!" And I always told myself I'd never let my child act that way. I'm not against butt spanking, so I figured that's how I'd accomplish that. But now that I AM a mother I'm realizing it's alot harder for me to spank my kid than I thought! I dont want to hurt my child!! He is 2 now and I have only spanked him maybe 4 times all together & every time it was only cause it was something very serious like hitting me or other kids or running into the street or sticking something into the light socket. If it's life threatening or harming himself or others then I feel ok spanking him cause he needs to know that's on a new level of wrong! But it still broke my heart to do it. My son is probably just acting his age, & I do realize that, which is why I am so understanding to his behavior. But this is my first child, at what point do u start to put your foot down? And how do u put ur foot down?! Like I said, I'm not against spanking but I'd rather not have to do that unless I have no other choice. I worry spanking will just teach him hitting is ok. So I'm here asking advice on other methods that seem to work. My son is going thru a hitting phase, throwing things at mom phase, & I know when he is doing it deliberately because he knows he isn't suppose to.. and that's exactly what's happening. He hits, spits, and throws objects at me BECAUSE I tell him not to! I feel like I have told him no so many times he just doesn't believe I'll do anything anymore. Sometimes I tell him I'll put him in time out if he does it again & sometimes I do but sometimes I dont.. so now it's like he just isn't phased by it anymore if I tell him he'll go to time out if he does it again. The boy just doesn't listen & he enjoys doing what he's told not to. (Typical for a 2 yr old, I know) but he still has to learn & be taught at some point.. & the sooner the better. Does spanking even work for any of you? What has worked well besides that? How do u girls get ur kids to behave better? What else can I try?? I don't expect him to be perfect, but I do expect him to stop hitting ppl and throwing every object he sees at ppl's faces. I just need some advice from other mothers on this plz I struggle to know how to discipline my wild son at this young age. Thanx