Servo and stepper triggering with limit switches

This is how the pins are mapped between the Uno and the CNC shield V3.
cnc shield Uno pins

Don't power the servo from the Uno 5V. It will need its own power supply, one that can provide at least 1A. It may "work" unloaded, but put a load on it and your Uno might start resetting unexpectedly.

What is the servo driver part number? Did you set the coil current limit according to the relevant procedure? That is very important.

Robin2's simple stepper code tutorial may be of interest.

The Stepper library is fine for testing, but the AccelStepper library or the MobaTools library can work better. Both libraries have examples to help in their use.