Certain characteristics can be selected for ("all female" is legal) but it is of doubtful legality to post discriminatory housing ads in terms of age.
This link[1] agrees with you, but I'm wondering how retirement communities get around this. I'm not talking about assisted living, but places like this[2].
This is for the landlord-tenant relationship. My understanding is that it's legal for people to advertise for roommates (with whom they share living space) based on pretty much whatever they want.