solar eclipse occurs when the moon is between the sun and the earth and the three o them lie in a straight line.
if can only occurs at the phase of the new moon when the moon passes between the earth and the sun.
the above diagram shows the posittion of the moon earth and sun during solar eclipse.