Energy and water are intimately interconnected and investigating them as a nexus is fundamental for sustainable and low carbon development. However, there are critical techno-economic challenges to the coupled planning and operations of the energy-water nexus due to increasing renewables characterized by high variability. To this end, the coupled complementary operation and optimal planning of the energy-water nexus is investigated in this paper to balance water demand and renewable energy production. The nexus includes basically cascaded hydropower plants, photovoltaic (PV) array, wind farm, local power grid and water management subsystem. The modelling framework of the nexus including hydropower/PV power generations, waked wind farm models, is established. A deep neural network-based temporal-spatial data-driven model is also proposed to establish a fast and accurate enough wind farm wake model. Then, an optimization framework is introduced to optimize the conflicting objectives and identify synergies and trade-offs among the nexus which also includes the wind farm layout optimization (WFLO). As a case study, an energy-water nexus including mini-hydro power plants, PV and small-scale wind farm is investigated. The results show that it is possible to achieve the converged optimal solutions to the coupled complementary operation and optimal planning of the nexus. In addition, the WFLO can also be achieved within the optimization framework to minimize the wake effects within the wind farm and hence to improve wind power conversion efficiency.