For those who prefer a graphical tool, "gnome-tweak-tool" ("ajustements" in French) works well to act on windows (enable "minimize windows"; choose left or right for the "close" or "minimize" buttons (in French, sorry) :
looking at your screenshots you want the buttons to be on the right side with winboze order. In order to achieve this, execute this into the terminal application:
gsettings set org.gnome.desktop.wm.preferences button-layout ':minimize,maximize,close'
If you want the buttons to be on the left site use
gsettings set org.gnome.desktop.wm.preferences button-...