https://grantwinney.com/using-pullup-and-pulldown-resistors-on-the-raspberry-pi/
When the PI is shutdown it is not off. Just in lower power mode.
From low power mode the PI can be told to start up when GPIO1 or GPIO3 goes low.
All Rpi versions either expose GPIO3 or GPIO1 at pin 5 of their 26-pin or 40-pin header, so that pin can always be used for waking up.
All the Pi's GPIO are digital. They are either on (high, true, 1, on, 3.3 Volts) or off (low, false, 0, off, 0 Volts). It makes no difference which synonym you use provided that the library accepts the term.
When there is no circuit the GPIO Pin is floating. To make a reliable reading when no circuit is made we need to set the GPIO to Pull Down or Pull Up mode using built in Resistors in the Pie.
Pull Down connects to ground so that no circuit reads LOW, closing circuit reads HIGH.
GPIO.setup(6, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
Pull Up connect to 3.3 Volts so that no circuit reads HIGH 3.3 Volts, closing circuit reads LOW.
GPIO 2 and 3 are special in that they have hard wired 1k8 pull-up resistors to 3V3 fitted on board
This means the circuit should be closed to read LOW and start the PI. Wire the circuit to ON on the switch. So the act of closing the circuit should read LOW and initiate startup. Does this mean HIGH or open means shut down? It should.
Connect Pins 5-6.
Pin 6 is Ground Black Wire
Pin 5 is GPIO3 White Wire. Dard wired with a pullup resistor so read LOW to detect circuit, but that will turn on PI so safe shutdown has to be triggered when Circuit is CUT.
Be careful will fry your PI if you connect bottom two rows of pins as they carry voltage.