S.H.
Kids at this age... DO NOT play, interactively yet nor know how. They do what is called "parallel play." Look it up online.
They do not know, social rules yet. Nor how to socialize.
But you need to teach him boundaries. Even if he does not fully understand yet... over time, their understanding of it will evolve. And get more sophisticated.
And... do not take him to socials or groups, when he is tired. When babies and kids are tired... or over-tired... this is bad timing, to take them to social events. They lack patience and focus when tired and get more fussy and over-stimulated and throw tantrums.
Make sure he naps and is rested, and fed, before taking him out.
You need to distract him at times like this. Tell him 'no.' Time outs at this age, well it will not be like a 5 year old.
Instead, with him, pick him up and take him somewhere else.
Don't lecture him or explain in too wordy a manner. Kids this age, will not have the attention span for it.
And yes, you have to always be near him and supervise. That is how it is at this age, and older.
Kids this age, have NO impulse-control, yet. Nor is it fully developed, yet. Even in a 2-3 year old.
Again, kids this age, do not know how to socialize yet nor interactively like an older child. At this age, they don't even understand emotions yet nor even know the names for their emotions and they lack... coping-skills for any frustrations.
Kids this age, simply are not fully developed yet, socially.
Even Teenagers are socially clumsy and don't know everything yet.
So your child, is very young, to be adept at this.
It takes all of childhood, to learn.
Heck, even many adults, don't know how to socialize nicely.
Keep your expectations, age appropriate.