How does the bone density test define osteoporosis?

Only partly. The dexa scan gives the bone mineral density at the hips, spine and forearm. These scores can predict osteoporosis: 't-score' of less than -2.5 is considered osteoporosis. However, many people suffer osteoporosis fractures despite having better bone densities. So, we also use other factors: age, ethnicity, size, family history, prior fractures, smoking, alcohol, other conditions to predict risks.
T score. The t score is the value used to determine normal bone .1 is a value.Between 1 and 2.4 i'd osteopenia. A value above 2.5 is considered osteoporosis.