Petition for Divorce
When you file for divorce, the petition or complaint asks you to state whether you and your spouse have minor children. At the end of the document, there's a section devoted to what you are asking the court to decide as part of your divorce. If you want custody of your children, this is where you would say so. Your complaint alerts the court that custody must be litigated as part of your proceedings, unless you and your spouse can resolve issues by agreement.
When your divorce involves children, your case typically becomes a bit more complex. Many states require that you attend a court-approved parenting class, even if you think you and your spouse can reach a custody agreement by consent. You might also be required to attend mediation to work out custody details on your own before the court will rule on them. Some states, such as Arizona, require that you attach a proposed parenting plan to your petition for divorce. The plan details which parent you think should have legal custody – decision-making authority for your children – and names the parent you think the children should live with most often, along with a schedule for contact with the other parent.