The green wire will go into one of the inputs. The green wire will be 0 or 5V depending on the switch state.
Then configure ports and pins, Input Signals, X Home to Port 1 pin 10 or which of the 5 inputs you have used, It will be one of the following 5 pins 10,11,12,13 or 15
You may need to tick the Active low too.
You also need to put the Black to ground (GND) or 0V and the Red wire to +5 Volt.