See https://duet3d.dozuki.com/Wiki/ConfiguringRepRapFirmwareCartesianPrinter#Section_Homing_Z for how to set the Z=0 point. If you require further help, please post your homez.g and homeall.g files.