Hello!
Usually the custodial parent claims the dependent (that is the parent that the dependent spends the most number of nights with) or as specified in your divorce/separate maintenance agreement. That said, you and the dependent(s)' other parent can agree on who will claim them, so long as the dependent is only claimed on one of your returns.
Both the dependents being over 17 moves them from making you eligible for the Child Tax Credit ($2,000) to the Other Dependent Credit ($500). If your income allows for claiming the Earned Income Tax Credit, you will want to ensure claiming the dependent that lived with you to qualify.
Here is a link to IRS's website that will provide you all the details of dependents of divorced parents.
Hope your day is great!
Elizabeth W., EA