Looking at your picture, I'd suggest your machine is currently in a position that represents X & Y at the maximum positive extents of their travel. You'd be operating the machine facing the spindle at the opposite end of the table from your Y-axis motor, at the left side of your picture. From that orientation, facing the spindle, your gantry is in the upper righthand corner of your work envelope.
If you take this orientation as correct, you need to configure something like this (presuming 1000 mm travel for example):
X Axis:
Your HOME SEARCH VELOCITY is a positive number
Your HOME OFFSET is 995
Your HOME is 5
This gives you 990mm of travel inside of soft limits. Your homing cycle will narrate as:
"Move in the positive direct of Y at HOME SEARCH VELOCITY until you encounter the switch. Back off the switch at HOME LATCH VELOCITY (a negative number in your case, since the sign needs to be opposite from SEARCH velocity), once you've barely creeped backward off the switch, define that exact point as the 995mm positive soft limit of the machine. Now, move backward 990mm to a point which is physically 5mm from the hard end of travel, and name that point axis soft limit ZERO."
So, you've turned the machine on, hit "Home" and this should happen if configured sanely:
1. Your z-axis (ideally homing at the TOP of its travel, with HOME_SEQUENCE = 0!) moves up as far as it can go before the other axes move. This will prevent a lot of snapped tools and gouged tables...
2. Your other two axes are defined with HOMING_SEQUENCE = 1 and 2 respectively, and each in turn finds it's limit switch, latches and moves to HOME.
In my case, my table homes at the operator end. When I hit Home, the spindle lifts, latched and stops, then the X-axis moves to the left, latches and stops, then the Y-axis moves in the negative direction toward me until it finds the switch and latches. As soon a Y-latches, both the X and Y simultaneously move to HOME -- which in my case is the midpoint of each axis.