Both parents have the right to custody until you are 18. If it is court ordered, you must stay with whoever you are said to stay with until you are 18. Once you are 18, you are no longer under custody laws, so you are free to do what you want.
Tell you parents about your wishes. They will usely concede. If not the parent can argue the case that the child wishes to be with whatever parent, and if the parent is capable of supporting and raising the child the judge will rule in that parents favor. Granted you have to present yourself as mature enough to make this decision. For example if the judge sees a parent just spoiling the child to make the child like him/her, and the child wants the parent just because of that. Then it's not going to work.
Yes you need to be at least 16 to be an emancipated minor but you need to be able to support yourself and maintain good grades.