Swap two windows when there are three
:h window-moving
(or simply :h windows
and then browsing down) lists all such stuff.
I believe you want CTRL-wCTRL-x (or CTRL-wx) (Window eXchange).
I do not believe that Matt's answer is what you are looking for. It only allows to swap the window with the next window. This may work for the given example but not for more complex situations.
I use the vim-windowswap plugin which allows to swap any two windows: https://github.com/wesQ3/vim-windowswap