The tests to claim a dependent start with 5 basic dependent tests. If two taxpayers both meet all tests, then there are tiebreakers that are very specific.
Of the 5 tests, you will both meet some of them...you are both related to the dependents, for example.
You must also provide MORE than half of the financial support for the dependent. Chances are, only one of you meets this test. But it is possible the nobody does. Financial support means the cost of a living place, food, and if tuition is paid, then that counts, too. Medical expenses and insurance are other related expenses. Who provides MORE than half?
Even if you paid $10K a year for each child, but he provided $11K, then the father would meet the test and you would not.
Housing is based on the cost for renting out a place of similar size/quality to a non-family member, by the way.
If the children earn their own money, only the money they spend on their own support is counted.
If nobody meets the More than Half rule, one of the tiebreakers is going to be the fact that the natural parent gets the first right to claim the children.
That's the non-emoitional side of the tax law.