No that is also illegal. You can not target advertisements based on protected characteristics.
> the Justice Department secured a settlement agreement with Meta (formerly Facebook) in February 2025, alleging that Meta’s ad delivery system used machine-learning algorithms relying on Fair Housing Act (FHA)-protected characteristics such as race, national origin, and sex to determine who saw housing ads