Ok well to be sure you really should post some pictures so we can see what you have. However, regards the OUTPUT wires then usually you can connect any of the U V W wires in any order, then if the spindle spins the wrong way swap any 2 wires over. You don't usually need or even have an Earth on the Output side.
Obviously you need to connect the INPUT Mains Earth wire, also the cable going to the spindle should be a shielded cable and you take the Shield to the Mains Earth. Don't Gnd the shield at the spindle end.

However, to be sure before doing anything I suggest you show us what you have.