My DD was 2 in March, she has a couple of friends we have known since birth who she will play quite happily (individually) with.
The problem arises when another child is introduced into the situation (either one she knows or one she doesn't), where she will withdraw totally from the situation, often going off to sit on a chair by herself and no longer wanting to play.
She is starting playgroup in September and I hope that this may help - although I'm worried it may not! She is an only (not sure if that's an issue or not, but thought I'd mention it!).
Most children don't really play together much before reception age. They play alongside each other and they tolerate each other, but it is not common for them to form strong attachments to particular children or groups. They will often play perfectly happily on their own. Honestly, don't worry about it .
As mintyy says, they're just not that social at this age - it will come in time, and playgroup will give her opportunities to do it as she gets older, but at 2 you should just be happy she can manage to play in a friendly way with one other child at a time, many of them struggle even with that!