"It's not working" is one of the most useless problem descriptions we get: it tells us absolutely nothing about the problem. We don't know if you get an error message, or the wrong data, or even that that code compiles successfully!
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
So tell us what happens when you run that code, what you expected to happen, how you checked what happened. Help us to help you!
But Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here ... 10 seconds with Google gave me solutions:
SQL max of four columns - Google Search[
^]
Including this:
sql server - SQL MAX of multiple columns? - Stack Overflow[
^]
In future, please try to do at least basic research yourself, and not waste your time or ours.