Listen, my dude. The wife and I work at disciplining young disrespectful sh1t bags like your wife and we get paid a lot of money for it. I can help you with him but I don't know about her, you two are clearly different, probably not much to salvage there, I would stop sleeping with her ASAP. I would also not take any advice from someone in an OPEN MARRIAGE because they've got a seriously unhealthy outlook on life and are probably secretly enjoying the debauchery. You don't want to be in this situation, don't take advice from people whose wives don't respect them and the sanctity of the marriage contract. This applies to you as well, if you want a tight ship you have to be a good Captain.
I've been married 15 years with almost zero problems because my wife and I are congruent on politics, child-rearing, and respect. It's likely because my wife is ex-military and I have a similar background, but the point is we're pretty strict and it works.
Get your kid watching these when you want to reward him, but only the stuff pre-2000 unless you want a 'confused kid'.
https://www.wcofun.org/cartoon-list
Now here's what you do.
Number 1. You start playing a game called 1,2,3,4.
1 - Standing at attention.
2 - Sitting with arms crossed.
3 - Standing at attention with hands behind the back.
4. - Sitting at attention with hand raised.
You play this game and tell your kid he can watch a cartoon episode of Dennis the Menace or something if he does good, you can download them from the site so that he can't just access them when he wants to. Anytime he fvcks up or is a sh1t bag, you walk into his room and take a toy away for a MONTH. Do it a couple of times and the little brat will know you mean business. I've tossed video games out of 8th-story windows, you have to get used to being the bad guy. You need to be able to set down rules and enforce them. I recommend these cartoons because they are lessons disguised as fun, they’ll teach him morals and ethics which he seems to lack right now.
Number two, you're going to play the hell out of this game. 30 minutes per day, every day for a year. Your child must perform the action precisely. No room for mistakes, inspect his posture, salute, and stance. Ramp up the difficulty as you go to keep him on his feet. When you're out and about during the day randomly yell (1,2) and watch how quickly those dominoes fall. Bring a pad and keep score. From now on, you've got to be Sgt. Slaughter... Trust me, kids love this game when they get good at it. Your kid doesn’t respect you right now because you don’t scare him. Be someone that scares him... think Darth Vader! When you walk in the room the Imperial March should be playing in his head. When his toys go missing one by one, he will begin to clean up his act. No hugs or kisses from Daddy until he straightens up.
The wife and I take care of the absolute worst classes of kids and problem children, we make them into coherent, well-behaved, and well-performing citizens. If this is something you’d be interested in, I can’t recommend these ‘games’ highly enough. Make your games physical so that the kid feels the burn at the end. Push-ups, running laps, cleaning toilets, these punishments work. Run your kid around your house until he wants to puke. It’ll be good in the end for both him and you. Don’t forget to stay hydrated. I guarantee he will thank you for it one day. Remember, if you don't take charge now, someone else will. As an ex jail guard, you don't want that person to be me.