The inclusion-exclusion principle is used to count the number of elements in a set that satisfy any one of several conditions. It states that the number of elements in the union of two or more sets can be calculated by adding the number of elements in each set, and then subtracting the number of elements in the intersection of each set.