Extend the follow path
/ > apps > metacity > general
Then select button_layout
Modify the value of button layout, type
The : (colon) which separate the button layout located on left hand side or right hand side.
The , (comma) which split the button layout one by one.
Then press OK
Also, there is a very simple way to set the button layout on terminal
gconftool-2 --set /apps/metacity/general/button_layout --type string menu:minimize,maximize,close
It is as same as the GUI settings