I think egeezer was very near the answer.
I you open dconf-editor in a terminal, navigate to org>gnome>desktop>wm>preferences
You will find at the right windows -> button-layout
You can see: close,minimize,maximize:
Double clic on the value and write -> :minimize,maximize,close
Pay attention that it starts with colon
That indicates that the buttons will be placed at the right side.
The change is automatic. Close the dconf editor.