When moon hides Sun from earth we get solar eclipse.
When moon enters shadow of Earth we get lunar eclipse. t lunar eclipse.
When Earth, moon and Sun comes i nstraight line we get ecloipses. But both orbits are not in one level.They are tilted by 5.8 degrees.So eclipses does not happen every month.