Rawls mentions two principles of justice arranged in lexical order. They apply to the very structure of the society and govern the assignments of right and wrong. The second one particularly speaks of the distribution of social and economic advantages.
First: each person is to have an equal right to the most extensive basic liberty compatible with a similar liberty for others
Second: (a) they are to be of the greatest benefit of the least-advantaged members of society, consistent with the just savings principle (the difference principle).
(b) offices and positions must be open to everyone under conditions of fair equality of opportunity.
According to the priority rule, the first principle must be observed and it cannot be violated for the sake of the second principle.
About the first principle he says that the right to free trade and the right to specific kinds of properties (means of production)are not basic liberties so they are not included in the first principle. The basic liberties include: political freedom, freedom of speech, liberty of conscience, freedom of thought, freedom from psychological and physical oppression and personal property. These need to be equal for everyone.
Now, wealth may not be distributed equally but it’s distribution should be to everyone’s advantage. And the positions of power and responsibility should be accessible to anybody. Rawls establishes here that inequalities that are not beneficial for all make injustice.