2 years younger, how old is he OP?
We all do stupid things as kids/teens, its hopefully a phase he will grow out of.
You need to stick by him, love him, try and slowly work around to stopping the racism, and also try not to get too passionate about your views with him, it will have a negative effect on him.
Me and my cousin are like you two, we even work together. We are not racist but hold severally different view points. At first it was quite awkward as any conversations we had if a hint of politics (or in the case of the time the Scottish Independence Referendum) we would have very very heated debates.
Now we talk about all sorts of things and yes our view points differ we are at a level now where we respect each others view points and can have a good discussion and even agree on things.
There is no place for racism but he needs to be told that you can't get away with these things in life in the real world. For his political views, fake news is a killer, but try and have discussions about it, get his view point, work out how he is believing what he is believing and get to know him more.
I couldn't cut my cousin off, we are different but that is a good thing. We can't all be the same.