I've been in your shoes - a peer got promoted to be my manager when our old manager retired. We were okay as peers, but very bad in a hierarchy, and I eventually got fired. I should have just quit instead.
Still, though, I think you're letting resentment blind you. It's easy to be the hero of your own story, and for anyone you're in conflict with to be the villain, but that doesn't mean it's right. We're all unreliable narrators.
Try this exercise. Repeat after me... "I may be wrong. I am often wrong." This is my mantra. Recognize your own fallibility. Try looking at it from the perspective of "What if I'm wrong?" It solves a lot of problems (or leads to the correct solutions). And the more you do it, the easier it is. Consider my earlier point, that what he did isn't incompetence - not if his goal was to get out of technical and into management. And since he's apparently good at those people things, he might well be recognizing where his talents are, doing the right thing for himself and the organization.
Consider also a telling bit of evidence in your response to me - "we worked together for two years on a daily basis". If that's true, is it also true that you did all the work and he unfairly claimed credit? What was he doing, if he wasn't writing code? Is "kiss-ass" a fair assessment, or an resentful interpretation of his useful work? Try to stop being angry long enough to consider that.
However, if this:
> I can't stand to report to him
remains true... the only solution in the end that will leave you with day-to-day satisfaction is to leave the situation. It sounds like you are aware of this.
Life is not always fair but in general it is consistent.
That's not true as I always hangout with the people in different teams, and, we get along pretty well. I just don't do kiss-ass to my boss and I don't take advantage out of situations.
> Find ways to work together
We worked together for two years on daily basis. And I overcome a lot of bad behaviours but I can't stand to report to him