If you live in New Jersey, the primary custodian is called the parent of primary residence. Illinois uses the term primary custodian or residential custodian. By any name, if you and your spouse can't reach a parenting plan on your own, the court will decide which of you should be the primary parent based on the best interests of the child. In some states, a statute will list factors that the judge must consider to determine who the most suitable custodial parent is.
When one parent has primary custody, it doesn't mean the other parent won't get to see his children. It simply means your children will probably not be dividing their time equally between your home and your ex's residence. Your visitation schedule with your children can be whatever you and your spouse agree on, or the court may fall back on a standard parenting schedule if you can't agree, such as every other weekend and one weekday evening.
Legal custody is different from physical custody – it's the right of one or both parents to make important decisions relating to your children's upbringing. The primary custodial parent does not automatically have sole legal custody as well.