Have you checked the wires near the motors not the connectors.?

Just looked at a couple spec sheets for the X motor and one says 8 wire, another says 6 wire. You show 4 wires at connector.!
You say 2 phase which would rule out 8 wire 4 phase and match 4 wires (2 per phase) wired Bi-polar series. It could also be 6 wire wired full phase bi-polar series which doesn't use the centre tap wire of each phase. Also could be wired Half phase which use's the centre tap and drops the outer phase wire, so still 4 wires.?

To determine which wires go to which phase and which wire is the centre tap then you'll need to use a meter and check resistance.
Between any 2 wires for each phase you'll get 2 different readings, one exactly half the other. The 2 that give highest reading are Full phase and it's these you want. Just tape the other wire up and don't use.
The 2 wires left are then A+ and A- of phase one. The other 2 wires from second phase are B+ B-.
These 2 pairs then go to the matching A+ A- B+ B- on the M542.
You won't know which is the + & - wire but it doesn't matter they will work fine just possibly spin in reverse if wrong way round or could judder. Just swap one pair around and test, you'll quickly find the correct way.

The Y axis use 4 wires so will be probably be wired the same.? Again test phases and wire just same to the M542.
You want full phase bi-polar series has they give best torque/speed but need more power.

The Z axis looks like it's using 6 wires so this tells me it's probably wired unipolar.? . . . Why when has same motor has Y axis I don't know.? . . .very strange.!!
In Any case just wire this the same has other motors.

For all axis set the M542 amps to 2.1 or next lowest, don't set higher unless very close. This is done using the DIP switches (little things on side) The drives data sheet will show you the combination position of switches to select correct amps or next closest.
To get the best out of these Series wired motors you'd want higher volts than the M542 50Vdc drives allow. So For power supply get close to drives max but still with a safety margin so you want 44-46 Max Vdc and approx 8A to be on safe side, 6A minimum.

Hope this helps more than confuses. . .Lol