Rousseau's theory of the General Will seeks to create a "public person", rather a society where all individuals are members of one body to create laws that serve everyone's good equally. The idea consists of basically giving oneself without reservation to the community which enables one to retain his freedom and security. The conditions of the General Will consist of no rich or poor, so that everyone is equal, no partial associations so that a common interest is maintained. It will also encourage people's loyalty to seek out the general interest by creating public education to teach people about the benefits of the General Will, a civil religion aswell as censorship to point out expressions that were contrary to the General Will. All individuals meet, deliberate discuss, and vote to make the laws according to whether the proposed law accords with the General Will. Each person is expected to express only their own view, and no one should be so poor as to sell their opinions while no one should be so rich as to buy them.
There is also a legislator who is an exceptional individual who knows the emotions of that society, and who suggests laws. As a result, if people are truly seeking common good, then not too many laws will be necessary. It should be fairly obvious what laws serve the common good. Further, if there is a division of opinion, the majority will be right about what law serves the common interest, and the minority is mistaken.
As everyone takes part in creating the laws with the good of all in mind, and where people are required to obey only laws that they gave to themselves, then in obeying the law they are following their own will and are therefore free.