It's great to have a friend at any age.Young preschoolers are just learning how to be a friend. Sometimes when a third child joins in the play, it can take a while to work out the social rules. Three can be challenging, but it's well worth the work.
Just when your child has found the joy of playing with a good friend, another child enters the play and often, one child feels left out. It can take some practice to play in a group of three. Two children may whisper or play in a way that excludes the third child. It can feel threatening to a child who thinks of their friend as "only their friend" to include another child in the play. In this situation a child needs to know that they are not losing their friend, but sharing a friend, and hopefully getting a new friend. Be patient, it can take time and practice to work out a way to all play together.
I often ask parents to stand back and allow children to try to work through social issues on their own if possible. In this case it can be helpful to explain to your child that everyone needs to be included in the play.
If a child feels threatened by the new addition to the group, try a playdate or two with just those two children, so they can get to know each other. Developing ways to play together can help the two children find their roles in any games that are played when all three children are together.
We're talking about children who want to play together, but sometimes have disagreements. This is not only normal during play, but it is an important part of social growth. You can disagree and still be friends.
Sometimes the personalities really don't mesh. You would not like being told to hang out with someone you really don't like. Most adults can be friendly if there are situations where you have to spend time with a person you don't enjoy being with. It is not fair to force children who don't get along to play together. But it is reasonable to learn how to get along with others when necessary. Practicing many different types of social situations will help your child grow in social skills and confidence.