When you think about children having to go to court during their parents' divorce, you can imagine how complicated everything may seem to them. Children can be overwhelmed by court, which is why they are not normally part of the process.
In most courts in California, a child will be old enough to have a say in their custody arrangements once they turn 14. The older they get, the more weight their testimony will have.
California takes many steps to protect the interests of children involved in divorce cases. The courts also know how easily children can be swayed by parents to speak out against one in court. That's why children are not allowed to determine their own custody arrangements, though what they say will be considered.
The courts know that children may have changing opinions as they grow older. At 14, a child may want to live with a parent of the same gender due to puberty or other changes going on. By 17, the teen may want to live with the parent who gives them the most freedom. Still, personal feelings do need to be set aside so that both parents have access to their children and can continue to build strong relationships with them.
If your child wants to speak in court and wants to say where they'd like to live, it's okay to allow it. However, keep in mind that what they want is not necessarily going to be the outcome of the case if you go before a judge. It may be better for you and your ex-spouse to work together to come up with custody arrangements that your child approves of.