There are several ways. The parties can agree as to parentage. Sometimes at the hospital the parents sign a Voluntary Declaration of Paternity (this acts as a Judgment of Paternity). DCSS, in their efforts to collect child support may have DNA tests ordered at no costs to the parents. Either parent can file a Petition with the Family Court asking to Establish a Parental Relationship.
Fathers are being more and more recognized for the value they bring to children (and not just for the money they may pay). Calfornia legislature says each parent shall have frequent and continuing contact with the children. More and more judges are interpreting that phrase to mean 50/50 parenting time absent circumstances that suggest the best interests of the minor children are better met with a different parenting schedule.
This is one of the most difficult and saddest of all custody disputes. Immediately contact counsel. Find out the options for your particular case. A custody evaluator may be appointed to determine what is in the best interests of the children which may be private or through the County. An attorney may be represented to represent the children. The best thing to do is to try to work this out with the other parent. This process is painful. Each parent says hurtful things about the other parent in an effort to convince the judicial officer why the Court should rule in favor of their requests. Once said, those things can never be "un-heard". You will be tied with the other parent for the rest of your lives through grandchildren and perhaps great grandchildren. The costs associated with contested move-aways are horrendous. Children feel the stress between the parents so have a double layer of pain, one losing the day-to-day contact with the parent and then the stress. Find a way not to harm your family. Mediation or collaborative law is the better way to go than litigation for financial and emotional reasons.
The older the child, the more weight the Court will give to the wishes/input of the minor child. A law was passed in the last few years that requires the Court to hear from the minor child who is aged 14 or older if the child asserts a desire to address the judge. Each judicial officer hears from the child in their own ways: Minor's counsel may be appointed, a person from Family Court Services in Orange County may interview the child, a Court may bring the child in chambers (sometimes with or without counsel present -- but never with parents present), sometimes the child addresses the Court in the courtroom etc.
This is an IRS question typically. The parent who contributes more money to the costs of supporting the child will usually be able to declare the child. With the health insurance penalties, sometimes the parent ordered to pay health insurance declares the child since they would be responsible for the sanctions for non-compliance. With a 50/50 timeshare, very often the parties split the declaration such that in even years one parent declares the children and in odd years the other parent declares the children. Sometimes the parents evenly divide the exemptions. It is better to have this in the Court order so there will not be later disputes.