Thank you for your question.
Since there is a court order in place, he would need to show to the judge why a modification of the existing order is warranted. He could explain a change in circumstance, but overall he would need to explain to the court why changing the existing order is in your son's best interest.
There is a presumption that a child's best interests are met through a relationship with both biological parents, so in that regard he stands a chance of maintaining visitation and/or potentially some custody. However, without a compelling reason, it is doubtful that the court will outright grant sole custody. You will have the ability to oppose your ex' petition, you can attached a declaration from yourself and your son, explaining why the current arrangement should not be changed and/or why it is not in your son's best interests to be placed in his custody. Within the reasoning in your declarations, you could explain your ex' current living situation and the fact that your ex has been unstable and in and out of your son's life. Your son is also of the age where his living preference will be given consideration by the court. Lay out each point objectively and factually in the declaration, try to keep the emotion removed from it.
The judge will look at the petition, the supporting evidence, and any opposition in making a ruling based on what is in your son's best interests.
Please let me know if you have any other questions, or require clarification of this matter. Otherwise please hit "ACCEPT", so I may receive credit for my response. Tips and feedback are also appreciated.