Please post your full config.g and homing files. Also share the results of M122 and M98 P"config.g"
In general, double check your motor wiring, and make sure that -x moves to the left, +x moves to the right, -y moves to the front, +y moves to the back. Change the motor direction of rotation as needed and ensure the direction of the homing moves is positive or negative as needed. The endstop positions must also be accurately defined in M574.