In this paper, a new framework for the participation of smart homes in the peer-to-peer energy market is presented, in which smart homes share their surplus energy with each other to maintain the balance between generation and demand through bilateral trading. The seller smart homes, players who always sell their excess energy to the buyer smart homes in the peer-to-peer market, are equipped with distributed energy resources including electric vehicles, power-only units, and uncontrollable loads. The buyer smart homes always interact with sellers as energy consumers to supply their flexible loads. The presence of battery energy storage systems in the model of these players, as well as active participation in load response programs, increases the flexibility and profit obtained from energy transactions. All players regardless of their role in the peer-to-peer market, have bilateral trading with the retail market considering real-time energy pricing rates to gain more profit. A fully decentralized method called the Fast Alternating Direction Method of multipliers (FADMM) is used to clear the developed market. To prove the effectiveness of the proposed framework, numerical studies are considered for the energy transactions of several smart homes with each other and with the retail market.