At the bottom left type> Power & Sleep when that pops up look right and click on >Additional Power Settings. Look top left and click on >Choose what the power buttons do ...and make sure it is set to >Shut down
-------------------------------------------------
If it's not that I have seen a few rigs that start up again whenever you touch the keyboard or move the mouse and it's super hard to get the machine to stay off since any teeny weeny movement or vibration makes the machine restart. That is in the BIOS settings. If you have a UEFI BIOS you can hold down the shift key while you restart your machine to get the troubleshoot screen to pop and you can find the setting in there UEFI boot to get to BIOS and see if your BIOS has that feature.