This paper presents an approach to prioritize customers for energy sharing among neighborhoods in a residential microgrid with a transactive energy market. The prioritizing framework is developed based on a multi-leader multi-follower game by considering the benefits of both buyers and sellers. The proposed energy trading framework is designed in such a way that all parties will have the opportunity to bid for electricity purchase or sell at different prices. In the proposed approach, the priorities are given to those customers for whom the prosumers (sellers) will have maximum benefits and at the same time, the buyers will purchase electricity with the cheapest pricing options. The proposed framework is implemented in a distributed manner on a residential microgrid where the prices are randomly considered for the bidding process. Analytical results are presented to evaluate the effectiveness of the proposed prioritizing framework.