The word Legitimacy means something which is good and right. Why the thing is right may be because it follows the law, a religion says it is right, or maybe it is naturally right. People may not agree about what is right, and because of this they may not agree what "Legitimacy" is and what is "Legitimate". There are two different uses of the word "Legitimacy"

Political Legitimacy

When a government is accepted by many people it is considered to have "Legitimacy". In the past, some different reasons were used to make people accept a government. In the Zhou Dynasty of old China the rulers said they were given the "Mandate of Heaven" which means that the ruler was chosen by God. This is similar to the divine right of kings doctrine in Europe, where kings would say they were chosen by God.

In the time of The Enlightenment, John Locke wrote that Legitimacy came from the agreement of the people under the government. In Western thinking, this has become the accepted meaning. Not all the people must agree, only most of the people. Most of the people must agree that the government is the best way to make laws and rule, if the government has Legitimacy.

Max Weber said there are three kinds of political Legitimacy:

 Charismatic Legitimacy- Legitimacy from people believing that a certain person is special and is the person most able to be a good leader. This may be because the person is very good at talking or many people like the person. Sometimes people will believe that the person is powerful because of a religion or God chose the person. This is also "Charismatic Legitimacy".
 Traditional Legitimacy- When a government is accepted by the people because it has similarity to governments in the past. When the people are ruled in the same way for a long time many may believe this government is good and changing will be bad.
 Rational-Legal Legitimacy- When a government has laws that make the rulers listen to what the people say and do what is good for the people.

Children and Families
In common law, legitimacy is the status of a child who is born to parents who are legally married to each another. In the opposite, illegitimacy describes someone whose parents were not married. Such a person was called "illegitimate", literally means “not legal” (against the law). Virtually everyone alive today has ancestors who were born illegitimately. 

People’s attitude towards illegitimacy has varied in different parts of the world.  In the Western world, especially in countries which were very religious, it was thought to be very bad for parents to have a child if they were not married.  It was thought to be a sin.  Illegitimate children were often called bastards. Historically, under English law, an illegitimate child was  (a child of no one) and so could not get an Inheritance from his or her parents. In older times, such children were often brought up by other people, sometimes by relatives.

Today people’s attitude has changed, and the laws have changed so that people born to unmarried parents are not discriminated against unfairly.  In the United States, people are not described any longer as “illegitimate” but as “born out of wedlock” (“wedlock” means “marriage”).  In the United Kingdom the idea of illegitimacy was stopped by law in 1991.  Fathers now have a responsibility to their children, even if they were born out-of-wedlock. Many religions still maintain that sex outside marriage is a sin, although they no longer say that the child lives in a state of sin.

References 

Civil rights
Social sciences
Law