A crucial aspect of a sustainable city is ensuring that energy and water supplies can adequately meet urban demand. With the scarcity of natural resources and growing electricity and water demand, it becomes increasingly important for consumers to manage their resource usage more efficiently. This paper proposes a novel perspective of demand-side management coordination strategy for a building's water-energy nexus to enhance the resilience and efficiency of the overall electricity-water-heating system. The model is formulated to optimally coordinates the onsite greywater recycling system, heating, ventilation, air conditioning (HVAC) loads, and distributed energy generation systems with a bidirectional grid connection in a residential building. All subsystems are controlled by a model predictive controller (MPC) receiving real-time time of use (ToU) pricing from electricity and water utilities. The presented mixed integer linear programming model is verified to meet the customers' demands while reducing the operational costs. Results are compared with benchmark systems lacking the water recycling or energy storage system showing 8.3 % operational cost reduction while reducing potable water consumption by 21.5 %. The effect of increased MPC control horizon is also studied showing reduction in cost with increased horizon. Detailed analysis of the proposed framework computational burden and effect of prediction errors is performed to prove the MPC adaptability and robustness. Testing under increased room size and different user preferences further validate the efficacy of the proposed scheme in reducing the operational costs.