So many good suggestions and experience here.
My daughter, off and on, will only play by herself too... her choice. She is not sad, she does not lack for anything, she is not lonely... she just, sometimes wants to play by herself. She is happy, that is her... she self-navigates very well for her age... she has always been that way.
And mostly, she KNOWS herself, very well.
I would ask her "Who did you play with at recess today?" And she'd say "I didn't play with anyone..." And I'd say "Oh, how come?" And she'd say "Because that is what I wanted to do, be by myself." Then I'd ask her "What did you do by yourself?" And she'd say "I just sat under the tree..." or "I just sat under the jungle gym.. and watch everyone..." But she'd always say it was her choice and she wanted to do that and simply didn't feel like socializing and wanted to just "relax" by herself and look at the sky.....
she is also the type that chooses her friends and is very social. But, she chooses friends and whether she even wants to socialize or not. She says she just doesn't feel like being noisy like all the other kids at recess or she just wants to chill. She'll even close her eyes and relax that way. If a kids asks her "Why are you by yourself?" She just tells them "Because I want to be."
From a young age, my girl really could know herself and navigate herself and is very self-assured. She is also creative and cerebral... and a great kid. But she is not a follower... which I am proud of her for. And she really is able to "discern" herself and her interactions. She is well liked in school and does not lack socially. But again, SHE chooses and does not get sucked into what other kids are doing. She 'can' be herself. So that is a real strong point...
I don't feel 'sad' for her if she is by herself... because I 'know'... she can handle herself and is not sad herself. If she was by herself, she CHOSE that, at that moment. And it was what she needed.
If your son is happy... then be happy.
He is okay.
There is a myth that a child can't be happy unless surrounded by lots of friends and doing typical kid things and kicking a ball around. But... it is not always true. Your son, seems to be real self-assured... and mature. He knows himself. That is a real strength... which not even some adults have.
In 1st grade, my daughter didn't connect with any kid either. (I dont' blame her they weren't real great kids)... and she was happy. She simply said to me "I dont' have friends this year... but its okay. Next year will be fine." And she'd further explain to me, that the bunch of kids in her class at that time, were "trouble makers" and they weren't they type she'd even want to bring home. She was right. Her extra radar about people, was on par. Even her Teacher said so. And that my girl, was the only one, that did not 'follow' the general trouble that the other kids were doing.
My daughter, chooses her friends. Consciously. And her decision IF she interacts, or becomes friends with someone... is with awareness.
Your son, seems fine.
Don't let him think something is 'wrong' with him.
He will blossom and find like minded kids.... don't worry.
I have a cousin like your son. Almost to a T. He is fine, grew up fine, and is very talented and well liked and happy... and has a good heart. That is the main thing.
All the best,
Susan