Please post your config.g, homeall.g and homes.g files.

Are you using a Z endstop switch or a Z probe to home Z? If it is an endstop switch, does it trigger at Z max (nozzle as far away from the bed as it can get), or Z min (nozzle close to the bed)?