Not particularly helpful, its pretty standard to home all dimensions simultaneously to save waiting time, nothing wrong with this, and the code shown runs things properly in parallel.
However here the problem is that there are two sensors on the same axis - that's the issue, you should have only one, and arrange the motors move in lockstep by using the same step pulses to both. If there are two sensors then there is a chance that they are out of alignment and homing cannot terminate.
When the rig is powered down the motors will relax to a symmetrical state and this should persist throughout the run without any need to correct the motors relative to each other (unless there's overload and miss-stepping, in which case you'd need to power down to recover symmetry). If the mechanicals aren't rigid enough that the relaxed state is symmetrical to the accuracy wanted it means the mechanicals aren't rigid enough for the accuracy wanted anyway I think.
Anyway if you do use two sensors, use one to home and the other to then adjust the relative position of the two motors, but check for this step failing and abort out with a fault code - rather than loop endlessly!