It had been raining heavily so the village was flooded. Correct.
It had been raining heavily because the village was flooded.This won't work by itself because it would suggest that the flooding caused the rain, instead of the rain causing the flooding. I