This is an interesting question, as there are two levels of "community" in William Golding's novel Lord of the Flies.
The first community is shaped by the reality that all the characters are British boarding-school boys. This is part of what sets the tone of community on the island, at least at first. We watch boys follow a leader because they have had to do so before (Jack and his choir), and we watch the boys all vote (or want to vote) for Ralph simply because he looks like a leader. The boys all tease and taunt one another just as they undoubtedly did when they were at school.
The result of that is that Piggy is excluded from the community. He is physically present, of course, but he is the target of every criticism and the butt of every joke. The circle of camaraderie is closed to him because he is fat, has asthma, wears thick glasses, and wants to do things in an orderly (and intelligent) fashion. When Ralph cruelly reveals Piggy's nickname, the taunting intensifies.
A storm of laughter arose and even the tiniest child joined in. For the moment the boys were a closed circuit of sympathy with Piggy outside: he went very pink, bowed his head and cleaned his glasses again.
This exclusion of Piggy from the community of boys is consistent and changes only when Ralph, Simon and a few others join the ranks of the ostracized.
The other communities on the island are defined by the two leaders', Jack's and Ralph's, philosophies--and some coercion. These communities are best described as tribes, and these two boys are their leaders. Ralph is reasonable and interested in things which will make everyone's lives better and which will result in rescue. Jack, on the other hand, is only interested in Jack. He is obsessed with hunting and cares nothing for any of his hunters unless they can be used to help him hunt more or better. Once he gets meat, he uses it as a bribe to attract the littluns to join his tribe and as a weapon to be used against any who do not care to join him.
Jack maintains his tribe (community) by force and violence, particularly by the end of the novel; Ralph does nothing special to try to maintain his tribe members, though he is dismayed as his tribe gets smaller. The members within each tribe cannot be defined as co-equals, as the littluns naturally defer to the older boys, and there is even a hierarchy among the older boys on each tribe.
The tribes are perhaps more like families in which the older kids either take care of or torment (abuse) their younger siblings. Jack's tribe torments one another; Ralph's tribe cares for one another. For most of the novel, these two communities manage to co-exist peacefully; however, an event that happens when they are together changes everything. Simon is killed, and the tribes become immediate enemies. In an act of aggression, Jack's tribe steals the only source of light and fire on the island (Piggy's glasses), and Ralph's decimated group tries to fight back, but to no avail. Soon the only community is Jack's totalitarian tribe and Ralph, alone.
From the beginning, the boys who were stranded on this island had nothing much in common other than that they were all schoolboys. Perhaps things might have divided differently if all the boys were closer in age; however, the result would probably have been the same because only a few of them were concerned at all about anyone's interests but their own.