The limit switches keep the controller from accidentally moving too far in one direction. They can also be used to home the machine and tell it where to start from.
Solder wire to the NC and common pins on each switch.
Put a little dab of gorilla glue on the switch then place it so the bearing block with hit the switch before going too far. A 1/2" in from the end of the rail is fine. Tape them in place, making sure they make good contact to the wood. The X axis ones were glued to the aluminum plate and it worked fine. If you have switches with holes for mounting you can drill and mount them that way. I couldn't find screws small enough for the mounting holes on the ones I had.
Run the wires up and out the hole for wires in the top of the case. I tacked them in place with wire staples.
Solder all of the common side switch wires into a 6 pin female header. Then solder the NC side wires to another 6 pin female header.