Officially, a person is unemployed if he or she is in the labor force but does not have a job. Therefore, in order to calculate unemployment, we need to understand how to measure the labor force.
The Labor Force
The labor force in an economy consists of those people who want to work. The labor force is not equal to the population, however, since there are usually people in a society who either don't want to work or are unable to work. Examples of these groups include full-time students, stay-at-home parents, and the disabled. (Note that "work" in an economic sense strictly refers to work outside of the home or school, since, in a general sense, students and stay-at-home parents do plenty of work!) For specific statistical purposes, only individuals age 16 and older are counted in the potential labor force, and they are only counted in the labor force if they are actively working or have looked for work in the past four weeks.
Obviously, people are counted as employed if they have full-time jobs. That said, people are also counted as employed if they have part-time jobs, are self-employed, or work for a family business (even if they don't explicitly get paid for doing so). In addition, people are counted as employed if they are on vacation, maternity leave, etc.
People are counted as unemployed in an official sense if they are in the labor force and not employed. More precisely, unemployed workers are people who are able to work, have actively looked for work in the past four weeks, but have not found or taken a job or been recalled to a previous job.
The Unemployment Rate
The unemployment rate is reported as the percentage of the labor force that is counted as unemployed. Mathematically, the unemployment rate is as follows:
unemployment rate = (# of unemployed / labor force) x 100%
Notice that one can also refer to an "employment rate" that would just be equal to 100% minus the unemployment rate, or
employment rate = (# of employed / labor force) x 100%
The Labor Force Participation Rate
Because output per worker is ultimately what determines the standard of living in an economy, it's important to understand not only how many people who want to work are actually working, but also how much of the overall population wants to work. Therefore, economists define the labor force participation rate as follows:
labor force participation rate = (labor force / adult population) x 100%
Problems With the Unemployment Rate
Because the unemployment rate is measured as a percentage of the labor force, an individual is not technically counted as unemployed if she has gotten frustrated with looking for a job and has given up on trying to find work. These "discouraged workers" would, however, probably take a job if it came along, which implies that the official unemployment rate understates the true rate of unemployment. This phenomenon also leads to counterintuitive situations where the number of employed people and the number of unemployed people can move in the same rather than opposite directions.
In addition, the official unemployment rate can understate the true unemployment rate because it doesn't account for people who are underemployed- i.e. working part-time when they would like to be working full-time- or who are working at jobs that are below their skill levels or pay grades. Furthermore, the unemployment rate doesn't doesn't report how long individuals have been unemployed, even though duration of unemployment is clearly an important measure.
Official unemployment statistics in the United States are collected by the Bureau of Labor Statistics. Clearly, it's unreasonable to ask every person in the country whether he or she is employed or looking for work each month, so the BLS relies on a representative sample of 60,000 households from the Current Population Survey. The Bureau of Labor Statistics reports the unemployment rate as defined about as well as five other measures of unemployment, which you can see here.