What determines the custodial parent. If you have shared physical custody, but ex has more overnights.
It’s whatever you guys agreed to or a judge determined.
Overnights can be unequal but still have shared joint and legal custody.
The parent with whom the children reside the majority of the time is, generally, the custodial parent.