Get your taxes done using TurboTax

If the custodial parent has the child for the most nights of the year and is providing most of the dependent care how is it legal for a  county judge to order that parent to “voluntarily” waive the right to claim that child so the other non custodial parent can receive the child tax deduction?