You should get the book, "1-2-3 Magic." You can read a lot, and decide what method is right for you, but I think this book is good. It highlights the importance of consistency and not getting emotional. It will be a bit of a challenge to bring him back now that he's started down a path, but if you are consistent and keep at it, after a certain amount of testing, he'll accept that this is really the way it is and he'll feel safer.
Kids test limits when they aren't sure they'll last. They want limits, and are basically saying, "Am I safe? Am I safe?" And if there's no consistent limit the answer is no. I've heard it likened to crossing a bridge, and pushing on the side rails and having them fall away. Not very safe. Then, once the rails are back in place, they will test them for a while to make sure they are really going to stay. If they fall away again, it's more proof that they really aren't safe. So you have to be consistent with limits. Then they can feel comfortable as they work through the challenges of their little lives, knowing that you're there with limits to keep them safe. It's a great big world out there, and we have to keep it little enough for them.
Time-outs can be effective, but in our family, we use them as a way to cool down, not as a punishment. Punishment works until they're teenagers, and then they realize you really don't have any power over them. It's important to establish a routine now, when they're little, of mutual respect and them wanting to please you because it feels good. Then later it won't be a power struggle. The power is already established.
You can read the book and start a new routine with him, explaining that this is the way it is, and if he forgets, you'll help him remember. Praise the good stuff. Give him high fives for good choices. And be consistent and kind and give him lots of love. These years are vitally important to who he'll be when he grows up...what is being put in place now about his idea of who he is will be what he draws on for the rest of his life. So by setting consistent limits and giving praise for good behavior, you can help him to feel proud of himself as he acts the way he's supposed to.
Good luck!