Under Washington law, children do not get to determine their custody arrangements. They may, however, get some chance to influence the court’s decision.
I have never seen a court allow a child to testify directly in court, as the court tries to avoid putting the children in the middle of the divorce – this would mean asking the child to be disloyal to one parent or the other, which could be very damaging to the child. The way that a child’s input generally comes in is through the testimony of a parenting evaluator or guardian ad litem (GAL).
When there is a significant parenting dispute in a case, especially when a parent is making accusations about the parenting ability of the other parent, the court will typically appoint a professional to do an investigation and report back to the court with recommendations. This person might be a parenting evaluator or a GAL. The roles are actually very similar, at least in my county (King), but the GAL may have some additional responsibilities. Part of that investigation often involves interviewing the children, if they are at an age where an interview might be helpful.
The purpose of the interview is not to directly ask the children what they feel about living with each parent. Remember, we want to avoid putting the children in the middle. The interviewer will generally ask more open ended questions, such as how they are doing, whether they have any concerns, etc.
If a child has strong feelings about one parent or the other, positive or negative, this is the place those feelings would typically come out. Therefore if a child expresses dislike, distrust, or fear of one parent, that is something that the evaluator/GAL would likely include in their report and reflect in their recommendations.
The maturity level of the child should also make a difference. Maturity is different from age. A child who says they want to live with one parent because they buy better presents is giving a much less mature (and thus less helpful) answer than one who says that one parent leaves them at home alone too much.