I'm going to answer from the perspective of U.S. law, because that's what I know.
age is a protected class
The idea of protected classes comes from whether Congress or a state legislature protected that class by passing a valid law prohibiting that kind of discrimination. We can describe that generally with protected classes, as a broad summary, but if you're actually going to get into the weeds of whether some kind of discrimination is legal or not you have to figure out the specific laws.
First, you have to ask what the context is. Is this employment discrimination? Public accommodations discrimination? Housing discrimination? Education discrimination? Each is governed by its own laws. For example Title VII prohibits employment discrimination on the basis of race, color, sex, religion, or national origin. Title VI has the same protected classes, but applies in programs and activities that receive federal financial assistance (like universities and hospitals and others). The Equal Credit Opportunity Act prohibits discrimination in providing credit on the basis of race, color, religion, national origin, and sex (like the Civil Rights Act) and adds on marital status, age, receipt of public assistance.
The Fair Housing Act prohibits discrimination on the basis of race, color, national origin, religion, sex, family status, or disability.
The Americans with Disabilities Act and the Rehabilitation Act add protections for discrimination on the basis of disability.
The Pregnancy Discrimination Act prohibits discrimination on the basis of pregnancy, and the Age Discrimination in Employment Act prohibits discrimination against those over 40 on the basis of age.
So if you're talking about neighborhoods, you're only looking at housing discrimination, and not public accomodations or employment or schooling or anything like that. The Fair Housing Act doesn't prohibit housing discrimination on age. The Age Discrimination in Employment Act doesn't apply to housing discrimination (and is one of the few that only goes one way, in protecting only people above 40).
How is that not the same as an “active white living” community that bans other races?
Because the Fair Housing Act prohibits whites-only neighborhoods, or any other kind of race discrimination in housing.
On a side note, there's also constitutional Equal Protection claims for governmental discrimination that comes from the Constitution rather than any law passed by Congress. Those aren't discussed in terms of "protected" class, but rather in "suspect class," where non-equal treatment on the basis of race, color, or religion is reviewed by the courts with "strict scrutiny" (and almost always struck down). Unequal treatment on the basis of sex or citizenship is subject to "intermediate scrutiny," which sometimes survives court review. Unequal treatment on the basis of pretty much anything else, though, gets "rational basis" review and basically survives if the government can come up with any rational reason for the rule.