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