In this paper, we propose a stable electrical grid model, in which a home with a Photo-Voltaic (PV) system and Vehicle to Grid (V2G) capable Electric Vehicle (EV) can operate in both grid-connected and islanded modes. The model is used for studying load transients, power-sharing, and fault analysis. The implemented control system overcomes challenging situations such as load changing and transient conditions by managing the power of the battery and PV and regulating the voltage and frequency in the islanded mode. The Maximum Power Point Tracking (MPPT) is modified to include a feature for limiting the power in case of islanded mode and fully charged EV battery. Furthermore, the droop control and virtual inertia is utilized in a unified control manner. The model is implemented in MATLAB/Simulink and deployed to a real-time simulation by using an OPAL-RT simulator to validate the feasibility of the proposed model. The results for the real-time simulations are presented, showing the capabilities for voltage and frequency regulation of the controller, in load variations and fault condition.