@Phaedrux I added M581 but it just always triggers as soon as the print starts. I tried S0 and S1. The head is far from either endstop when the print starts so I know its not touching the switch.
M581 T1 X Y S1 R1 ; set endstops as estop and pause on trigger while printing