Thank you for your question.
I'm assuming the other parent will not stipulate to a modification of the custody agreement. In that case, a court must do two things: First, they have to determine if a material or substantial change in circumstances has occured since the original order was entered. Second, the court must determine whether modifying custody would be an improvement for and in the best interests of the child. If the case is contested, the parties will have to present evidence of both.
A substantial/material change can be any number of things - a child could be living in a dangerous environment, a child may do better in a different school, a parent has remarried, changing the dynamic of the household, etc. In other words, there is no set definition of what a court would necessarily find substantial or material.
As to the best interest of the child
, factors a court will consider can include things such as (and this is by no means an exhaustive list): the distance between the parents' homes, whic parent is best able to provide for and meet the needs of the child, which parent is most likely to allow frequent and continuing contact with the other parent, the child's preference (at 12, a court may consider your son's wishes, though they are not binding on the court), and whether there is a history of - or potential for -things like domestic violence
, child abuse, kidnapping, etc.
Modifying a custody order can be challenging. Family court judges are in my opinion creatures of habit who believe that if a child is healthy, happy and in a good environment, why should that be changed? That is for you to establish -that there has now been both a substantial or material change in circumstances AND that your son's interests would be better served by living with you.