The concept of active distribution network has emerged by the application of new generation and storage technologies, demand flexibility, and communication infrastructure. The main goal is to create infrastructure and algorithms to facilitate an increased penetration of distributed energy resources, application of demand response and storage technologies, and encourage local generation and consumption within the distribution network. However, managing thousands of prosumers with different requirements and objectives is a challenging task. To do so, market mechanisms are found to be necessary to fully exploit the potential of customers, known as Prosumers in this new era. This paper offers an advanced retail electricity market based on game theory for the optimal operation of home microgrids (H-MGs) and their interoperability within active distribution networks. The proposed market accommodates any number of retailers and prosumers incorporating different generation sources, storage devices, retailers, and demand response resources. It is formulated considering three different types of players, namely generator, consumer, and retailer. The optimal solution is achieved using the Nikaido-Isoda Relaxation Algorithm (NIRA) in a non-cooperative gaming structure. The uncertainty of the generation and demand are also taken into account using appropriate statistical models. A comprehensive simulation study is carried out to reveal the effectiveness of the proposed method in lowering the market clearing price (MCP) for about 4%, increasing H-MG responsive load consumption by a factor of two, and promoting local generation by a factor of three. The numerical results also show the capability of the proposed algorithm to encourage market participation and improve profit for all participants. (C) 2017 Elsevier B.V. All rights reserved.