Over $16 million of public funds went to Indiana private schools with anti-LGBT policies last year, a recent Chalkbeat investigation found.

You might be asking: Is it legal to discriminate against those students?

The answer is yes, and that’s become a focus of the national debate about school choice. (U.S. Education Secretary Betsy DeVos fanned the flames on this one when she offered ambiguous answers about whether all students would be welcome in schools that participated in a potential national voucher program.)

But the rules are tricky when it comes to private schools, especially religious ones. Here’s your guide to understanding when, why and how private schools can say no to certain students.

Are there laws in place that prevent discrimination against LGBT students?

There is no federal legislation explicitly protecting LGBT students from discrimination in schools. That means when it comes to gender and sexuality, Title IX of the Civil Rights Act — which prohibits discrimination on the basis of sex — is the main piece of legislation in play.

Title IX applies to private schools that accept federal funds — and many private schools do, usually through school breakfast or lunch programs, grants, or funding for low-income students.

However, some schools qualify for exemptions. All-boys or all-girls schools are allowed to restrict their admissions accordingly, for example.

Most important to the discussion of LGBT students: Private schools run by religious organizations are exempt “to the extent that application of Title IX would be inconsistent with the religious tenets of the organization.” A majority of private schools in the U.S. are religious, which means that most private schools are free to discriminate against LGBT students on religious grounds.

In Indiana, Chalkbeat found that at least 27 schools that accept vouchers have policies that suggest or declare that LGBT students are unwelcome.

What about private schools that aren’t religious?

At non-religious private schools, Title IX’s nondiscrimination rules do apply. But a change in interpretation means the law offers fewer protections to transgender students than it has in the past.

Under the Obama administration, the ban on discriminating on the basis of sex was interpreted as related either to biological sex or to gender identity. However, the Trump administration rescinded guidance on that front — meaning the federal government considers Title IX to only bar discrimination based on a student’s biological sex.

Do any states have laws that prevent discrimination against LGBT students?

Many states have implemented their own nondiscrimination policies regarding sexual orientation and gender identity — in the world of public education. But no voucher programs have such policies in place, research shows.

As a result, private schools are free to turn away LGBT students while still receiving public funding for accepting vouchers.

What about other forms of discrimination?

Private schools can’t discriminate on the basis of race if they want tax-exempt status. The executive director of the Council for American Private Education, Joe McTighe, said he wasn’t “familiar with any nonprofit private schools that elect against tax-exempt status.”

If private schools accept federal funds, they are also bound to Title VI of the Civil Rights Act, which prohibits discrimination on the basis of race, color or national origin.

When it comes to students with disabilities, private schools have more leeway to turn students away.

This is partly because students who choose to attend a private school — including through a voucher program — forfeit their right to a “free appropriate public education” that they are otherwise guaranteed by the Individuals with Disabilities Education Act.

Another law, the Americans with Disabilities Act, bars discrimination on the basis of disability and requires private schools to accept students so long as only “minor adjustments” are needed to accommodate them. But it exempts religiously run private schools.

Under a third law, Section 504 of the Rehabilitation Act, those protections apply to religious schools, too — if the school receives federal funds.