Ferdinand Julius Tönnies, one of the most influential social philosophers, had already developed his theory of community and society by the time that Durkheim developed his own.
Overall, both theories hold that society, community, and the individual operate separately while still being interdependent on each other. The theories differ in how each philosopher describes each of those terms and the rationale behind the way in which they interact.
InTönnies theory there are two separate orders in society. One is the Gemeinschaft, which corresponds with the modern definition of community. The other is Gesellschaft which is what we know as society. In order to keep these two orders functioning there has to be what he named Wesenwille (essential willingness) and Kürwille which is individual will.
The Gemeinschaft (community)is a product of Wesenwille (essential willingness to keep the community safe, together, etc)
The Gesellschaft, society as a whole, is a product of the individual will to abide by the rules, do onto others, and accept established rules and protocols.
Therefore, community is separate from society but it is a part of it.
Like Tonnies, Durkheim also views that society has a system of common core values whose purpose is to maintain the stability of society. Durkheim argues that society works organically, that is, as a living thing of its own where there are more interdependent dynamics than in Tonnie's theory. In the latter, community and society are two separate entities that coincide in terms of willingness. Durkheim views society as a system of which is part is completely necessary.