I will offer an answer in terms of political terminology, but so first as a definition of "society," with the caveat that "community" might be equivalent to or at least a peculiar proper subset of "society."
Now, there's a naive "political compass" popular in various corners of the Internet, that tries to situate the right/left and freedom/authority dichotomies so as to yield the so-called compass. Notwithstanding its naivete, I will take this "model" as a point of departure in presenting my own. My motivation is trying to separate conservative/liberal (or conservative/progressive) from right/left, while showcasing the affinities between these categorizations, and in turn attempting to avoid prejudice against any of the four subcategories.
So, perhaps greatly oversimplifying what's at stake, let's say that the two freedom/authority vectors are (A) the range of punishable offenses and (B) the severity of attendant punishments. Factor in a simple min/max function, and you get the following "compass":
- Minimum A-range, minimum B-range: anarchism (for min(x) = 0), or then libertarianism or, I think, a peculiar option that Hannah Arendt spoke of as "isonomy" ("no rulers or ruled," but still not quite anarchism, somehow).
- Min(A), moderate(B): conservatism. Moderate(A), min(B): liberalism.
- Min(A), max(B): the Right. Max(A), min(B): the Left.
- Moderate(A, B): moderates/the Center.
- Moderate(A), max(B): nationalism. Max(A), moderate(B): socialism.
- Max(A, B): national socialism, i.e. totalitarianism.
Historically, there is often a meaningful overlap between urban populations and liberal/Left perspectives, and between rural populations and conservative/Right perspectives. Modulo the nationalism/socialism dichotomy, this seems (to me) to become the assertion that nations and societies are similar entities, with nations being the spatial example of what societies are a temporal example of besides.
If a community is not merely a society/vice versa, then, perhaps the distinction lies in the scale: a community is a smaller temporal (and accompanying spatial) unit of the kind of structure that a (national) society is the broader-scale case of.
Caveat: again, I suspect I'm oversimplifying a lot of these terms' definitions/usages. I have not, for example, situated the concepts of empires or civilizations, here. Or, by default, so-called "secret societies" can hardly be as large (in time) as nations (in space). Anyway, though, I hope this "speculation" (or wordplay?) is relevant to your question!