The exact syntax varies a bit depending on which version of Marlin you’re using.
I’m not able to search for it right now, but @DougJoseph has a thread about swapping X and Y axis where he posts the exact process for an older version, and I posted late in that thread on how to do it for the most recent version.
Use the search button, or I’ll try to find it and post a link later today
Edit - links added…