I fixed it !!. my endstops were on NC, I put a ! in front of it to make it a NO and now it works
I used the normal code for the home command and the M574 in my config.
I found this other forum post from a guy with a similar problem. https://forum.duet3d.com/topic/20318/mpcnc-duet-3-sbc-dual-endstop-for-x-and-y-axes?_=1609092505581
And I read from this link https://duet3d.dozuki.com/Wiki/Bed_levelling_using_multiple_independent_Z_motors#Section_In_RepRapFirmware_Num_3
that @Veti provided that in 3.0 and above you don't have to separate the axis.
Thanks, @Phaedrux for noticing my error in the code, that would probably have taken me a day to figure out.