There is a form for parental release that is filed when appropriate.The other parent signs that they release the excemption.
Some support agreements allow for parents to alternate years, or release the parent from the other claiming falsely. If the father or other agency pays for more then half the childs support,.
The other issues is the child credit that allows for an extra amount. Some parents can file that even if the child did not live with them, or visa versa,
I think the online software will be able to sort out what is legal by the prompts it ask.
I know my husband could claim a step child, I know my brother was able to claim a sister in law he provided all her care.
There are a few different issues going on.
Especially of any spouse or child support comes back to the picture.