Criminal Law Questions? Ask a Criminal Lawyer.
A 17 year old cannot decide where he wants to live. Adults are supposed to do that. The juvenile court is now in charge of your son. Just because you have custody papers, that will not mean you automatically get your son back with you. The problem is that he was apparently living (with your approval) in a house where there was drugs. You might be the best person in the world, but the court apparently has a problem with that. If you did not even know what his father was up to, that is a problem. And, if you did know, that is another problem. So, the court is going to check you out and possibly take their time in moving your son.
Another problem is that the laws require a child to be returned to the home they took him out of, or at least try to return him. If they send the boy to California, that would not be possible.
He will soon be 18, so the court might take that into consideration and let him come home with you once they check you out.