In Maryland, children don't really get to choose which parent they want to live with. However, from a practical standpoint, the Courts do tend to start paying attention to children’s expressed preferences as they get older. While there is no magic age, this typically happens somewhere around 10 or 11 years old.
By around age 16, the Court system recognizes that an older minor child can essentially control what they're going to do, who they're going to do it with, and where they're going to live. A 16-year old child is not an adult, nor does he or she does have the legal competence to make decisions for themselves. But, from a practical standpoint, the child’s expressed preferences are likely to have more bearing on what a Court would order by this age.
Under any of these circumstances, if there's not a child custody agreement in place and the child’s expressed preferences are somehow different than what either parent wants, the Court may appoint what's called a best interest attorney for the child. A best interest attorney is essentially an advocate for the child, and/or her perspective and input is likely to be much more predictive of what a Judge will ultimately rule than the child’s expressed preferences alone.