If your efile rejects because he claimed her you will have to print and mail your return this year and let the IRS determine who can claim her. They will eventually send you both letters.
If you or a dependent that you are entitled to claim has already been claimed by another taxpayer, your e-filed return will reject since the SSN has already been used (either intentionally or in error such as a mistyped SSN).
Your only recourse is to file a correct tax return, claiming what you are entitled to claim, then print and mail the return.
The IRS will process both returns and pay any refunds. Shortly (within a year) the IRS will mail letters to both taxpayers asking if their tax return was filed in error and suggesting that they amend if they improperly claimed.
If neither taxpayer amends, the IRS will send a second letter asking for each taxpayers proof that they are entitled to the claim.
The IRS will evaluate each taxpayers claim and award the credit to one taxpayer, the other will have to payback any refund received plus interest and possible penalties.
Do not ignore the letters or you will loose.
It’s important to understand that a stepparent has the same legal right to claim a child as a dependent as a biological parent, and this relationship does not end with divorce, according to the tax code. Your ex will always be your daughters stepparent according to the tax code and will always have certain legal rights to claim her as a dependent.
The other half of your statement, that your daughter did not live with your ex for at least half the year, would certainly preclude your ex from claiming the child as a dependent using most of the normal rules. But your statement that she is not “his“ anymore does not have any basis in the tax code.