Try initially wiring just one axis, and connect and configure the other axes once you have one connected as expected.
If as soon as you try to jog the axis you get a 020 error, it is possible that the motor is tuning in one direction while the encoder is reading in the opposite direction. This can easily be fixed by inverting the A and B coils going from the driver to the motor. This inverts the motor direction.