How to exchange two keys on the keyboard (El Capitan)
Use the (free) program Ukelele.


Create a new keyboard layout based on your current one (File -> New From Current Source).
On the graphical interface click on the key to which you want to assign a different value, then  provide the intended output:


Save the new layout as a .keylayout file to /Library/Keyboard Layouts*.

Log off, log on.
Open System Preferences and select the new layout in Input Sources -> + -> Others -> your_layout_name.




* You can also save the file in your user's Library folder instead of the system one, but then if you lock the machine (i.e. switch to the lock screen), the keyboard layout might change at each unlock.