Job Discrimination in the Workplace.
If your employer doesn't like you and fires you, it isn't necessarily actionable discrimination. The employer must be discriminating on the basis of a "protected category" for the discrimination to be illegal.
The specific categories which are protected are spelled out in particular laws, or statutes. Because gender, or sex, is one protected category, everyone is protected by at least one category. Many people fall into more than one protected category.
The Courts & Statutes.
So far, the courts have allowed employers to discriminate against people on the basis of long hair and facial hair (except when worn for religious reasons), weight (except when the weight is because of a medical condition), and because the employer wants to hire a family member or promote a family member.
Under the law, an employer can refuse to hire you because you are too young, but not because you are too old (over forty). None of these are protected categories. In other words, if the category of the discrimination isn't spelled out in a statute, the employee is not protected from that form of job discrimination. Therefore, if the boss doesn't like you, but you don't know why, or the category isn't protected by law, he can fire you or not hire you for that reason.
Why were you fired?
The essential consideration is why were you fired or not hired? Was it because of your age or race or gender, the boss just didn't like you or wanted to hire his brother, etc.? What matters is the motive in these types of cases.