At some point in your child's life they will do things not because you tell them to, but because they are the right thing to do. For example, a 40 year old pays their bills because in this society we pay our bills, not because their mother called and reminded them to pay their bills. As a parent, one of your tasks is to escort your child from the toddler stage, where you tell them to eat, stop eating, wear these clothes now, sleep now, wake up now and so on to the stage of adulthood where they decide what to do and they do the right thing because it's right.
If the only reason your 12 year old goes to school is because you say so, then as you've seen, it's simple enough to throw off your authority and not bother going to school. And if you assert your authority more strongly, they can throw off your authority more strongly, including name calling and tantruming. This can escalate indefinitely but you won't get what you want that way.
Instead, back up a bit. How many decisions does he get to make for himself every day? (What to eat, what to wear, whether to do homework first thing on getting home or after a little playtime, etc.) Can you grant some more decisions to him? Not in an "I don't care what you do, eat or not, it doesn't matter to me" way, but in a "hey, you're not a baby any more, I trust you to look after your bodily needs" way? If so, you may meet some of his desires for independence. As well, if you simply reduce the number of things you tell him to do each day, you will reduce the number of times you're disobeyed which should make you feel better even if the instances of obeying don't increase.
And of course, talk to him. Why doesn't he want to do whatever it is you've just asked him to do? Is it because you're asking him to wear something he thinks is embarrassing, or because he hasn't yet learned that parents don't enjoy chores either, or because his homework has suddenly become very hard for him, or because something unpleasant is happening at school and he wants to avoid it? You can't just ask a 12-year old these things straight out: they often don't know and if they do know they don't want to tell you. But you can talk to them about day to day things and start to build up a picture of what's going on in their heads. If you're doing a chore together, it's a nice time to chat and way less pressure than "come and sit here, we need to talk." Doing chores together is also a way to make sure they do them, and stirs less resentment than sending them off to do it alone while you do something else.
Try to model the behaviour you want from him. For example, if you react to being called a name with white hot anger, you're showing him that getting really angry when people say something you don't like is how adults behave. If you react by saying calmly "I know I'm not stupid/selfish/lazy and it's rude for you to call me that" then you're showing him a different way to deal with name-calling.
This is a really hard few years. But it doesn't sound from your short question like it's time for you to give up and try to have someone else turn him into an adult.