Axis A and B do not home correctly

I have troubles with Home all and Home function.
The axis A and B should go to the end of their cycle and then come back to 0 degrees but Axis A is turned to - 16 degrees approximately and Axis B is shifted to aprox 7 degrees. Because of that when I try to measure my tool it doesn’t connect with the button but touches base of the Stock Bed.
How can I relearn the Home position of Axis A and B ?
In this picture the machine is in Home all position.