In a court of this state which has jurisdiction to decide child custody matters, a child custody proceeding is commenced by a parent:
(1) by filing a petition for dissolution or legal separation; or
(2) where a decree of dissolution or legal separation has been entered or where none is sought, or when paternity has been recognized under section 257.75, by filing a petition or motion seeking custody or parenting time with the child in the county where the child is permanently resident or where the child is found or where an earlier order for custody of the child has been entered.
Written notice of a child custody or parenting time or visitation proceeding shall be given to the child's parent, guardian, and custodian, who may appear and be heard and may file a responsive pleading. The court may, upon a showing of good cause, permit the intervention of other interested parties.