This paper proposes a novel energy management framework by combining proactive and reactive approaches to efficiently address the uncertainties associated with generation and demand in islanded and interconnected operation of residential microgrid (MG). The MG considers renewable energy sources (RESs), a diesel generator (DG), and a storage device with the possibility of power exchanges with the grid. The proposed formulation is cast as stochastic mixed-integer linear programming (MILP) model with 24-hour rolling horizon, simulated periodically by updating input data and advancing on an hourly basis for a one year scheduling period. The objective is to minimize the total MG cost while preserving comfort priorities of individual households. ...