Unless you meet certain criteria, your military health coverage stops on the day of the final divorce decree. So it’s a smart move to know your options – for both yourself and your children.

Here is who can stay on military healthcare plans, known as TRICARE, and why:

Minor children. They are still dependents sponsored by the service member and will retain military IDs and benefits as dependents. However, stepchildren who weren’t adopted by the service member won’t be eligible.

These spouses were in long marriages (at least 20 years) to service members with long military careers (at least 20 years). AND, here’s the extra kicker: The 20-year marriage and 20-year service career have to overlap.

Former military spouses who almost meet the 20-year marriage-and-career overlap requirement. They can remain on military health insurance for one year after the final divorce decree if they meet the “20/20/15” rule. The “20/20” part of the equation is the same: The couple was married at least 20 years and the service member was in the armed forces for at least 20 years. But the marriage and service record overlapped only for at least 15 years.

So what happens for everyone else? Obviously, the “20/20/20” and “20/20/15” rules will exclude a lot of former spouses. But the military does offer a temporary solution for those who aren’t eligible to remain on TRICARE. They can pay for what’s known as the Continued Health Care Benefit Program and stay on a plan similar to TRICARE Standard for up to 36 months.

The CHCBP program is run by Humana Military Healthcare Services under a contract with the Department of Defense. To be eligible, you have to sign up within 60 days of losing your military coverage. Premiums are high; in 2015, premiums were $1,275 per quarter for an individual. But also compare the plan’s deductibles, co-pays and annual spending caps to what’s available on the individual health market to determine overall value.