This paper addresses a net zero energy home that utilizes renewable energy resources (i.e., photovoltaic solar cells and small scale wind turbines) as well as battery energy storage systems (BESS). In the introduced system, the generated power by renewable energy resources is used to supply the energy of home, and BESS is applied for energy time-of-use arbitrage. As well, the extra amount of energy is utilized for electrolysis of water into breathable oxygen and hydrogen gas as fuel of hydrogen vehicles. The proposed problem is mathematically expressed as mixed integer nonlinear programming (MINLP) and solved using particle swarm optimization (PSO) technique. Objective function of the problem is to minimize number of charging-discharging cycles resulting in increasing life-cycle of BESS. The proposed optimization problem also finds the optimal capacity and power for BESS. Simulation results demonstrate that the proposed technique can successfully manage net zero energy home and optimally utilizes renewable energy resources, BESS, and hydrogen vehicles at the same time