A value will be excluded from a rational expression if it causes the denominator to be zero as dividing by zero is undefined.
An example that would work for your specific question is:

If you plug in either 2 or 5 into this equation the denominator will be zero causing the expression to undefined there, so the values 2 and 5 are excluded from the domain of the expression.