Here’s my setup, which replicates yours and your needs just both Xboxs are in the same house…
I have the ‘master’ Xbox account, and Xbox Live Gold is in my name. On this account I’ve added both my kids as family members with screen time and parental controls set up (purchase requests enforced etc)
Xbox A is set as my ‘home’ Xbox with profiles for all of us. All purchases are made on this one, either by me, or ones of the kids. On this one, anyone just needs to sign in, and they have access to all the games and the Xbox Live Gold.
Xbox B just has profiles for all of us on. If a kid or I want to use it, my profile needs to be signed in before one of theirs. If this is done, they have access to all the games and Xbox Live Gold.
I suggest you set up the one at your ex’s place like my Xbox A, and the one at your place like my B. Then they have ability to play anything at your ex’s without you needing to sign in, but time is still controlled by screen time and they need to make a request to buy anything or more screen time that can be remotely approved by phone. Your house does require you to sign in, but you’ll be on hand to do so, and then everything else is the same. This removes the need for your ex to know your sign in details.
All the parental controls and other setup are best done through the website, it’s loads easier than dicking around with a controller to type everything in. There is supposed to be a new mobile app to do it all, but I haven’t tried it yet.
Alternative suggestion:
Have one Xbox and move it between each house, with sets of cables and controllers at each property to make connection quick and easy.