(1) A child’s grandparent may seek a grandparenting time order under 1 or more of the following circumstances:

(a) An action for divorce, separate maintenance, or annulment involving the child’s parents is pending before the court.

(b) The child’s parents are divorced, separated under a judgment of separate maintenance, or have had their marriage annulled.

(c) The child’s parent who is a child of the grandparents is deceased.

(d) The child’s parents have never been married, they are not residing in the same household, and paternity has been established by the completion of an acknowledgment of parentage under the acknowledgment of parentage act, 1996 PA 305, MCL 722.1001 to 722.1013, by an order of filiation entered under the paternity act, 1956 PA 205, MCL 722.711 to 722.730, or by a determination by a court of competent jurisdiction that the individual is the father of the child.

(e) Except as otherwise provided in subsection (13), legal custody of the child has been given to a person other than the child’s parent, or the child is placed outside of and does not reside in the home of a parent.

(f) In the year preceding the commencement of an action under subsection (3) for grandparenting time, the grandparent provided an established custodial environment for the child as described in section 7, whether or not the grandparent had custody under a court order.

(2) A court shall not permit a parent of a father who has never been married to the child’s mother to seek an order for grandparenting time under this section unless the father has completed an acknowledgment of parentage under the acknowledgment of parentage act, 1996 PA 305, MCL 722.1001 to 722.1013, an order of filiation has been entered under the paternity act, 1956 PA 205, MCL 722.711 to 722.730, or the father has been determined to be the father by a court of competent jurisdiction. The court shall not permit the parent of a putative father to seek an order for grandparenting time unless the putative father has provided substantial and regular support or care in accordance with the putative father’s ability to provide the support or care.

(3) A grandparent seeking a grandparenting time order shall commence an action for grandparenting time, as follows:

(a) If the circuit court has continuing jurisdiction over the child, the child’s grandparent shall seek a grandparenting time order by filing a motion with the circuit court in the county where the court has continuing jurisdiction.

(b) If the circuit court does not have continuing jurisdiction over the child, the child’s grandparent shall seek a grandparenting time order by filing a complaint in the circuit court for the county where the child resides.

(4) All of the following apply to an action for grandparenting time under subsection (3):

(a) The complaint or motion for grandparenting time filed under subsection (3) shall be accompanied by an affidavit setting forth facts supporting the requested order. The grandparent shall give notice of the filing to each person who has legal custody of, or an order for parenting time with, the child. A party having legal custody may file an opposing affidavit. A hearing shall be held by the court on its own motion or if a party requests a hearing. At the hearing, parties submitting affidavits shall be allowed an opportunity to be heard.

(b) In order to give deference to the decisions of fit parents, it is presumed in a proceeding under this subsection that a fit parent’s decision to deny grandparenting time does not create a substantial risk of harm to the child’s mental, physical, or emotional health. To rebut the presumption created in this subdivision, a grandparent filing a complaint or motion under this section must prove by a preponderance of the evidence that the parent’s decision to deny grandparenting time creates a substantial risk of harm to the child’s mental, physical, or emotional health. If the grandparent does not overcome the presumption, the court shall dismiss the complaint or deny the motion.

(c) If a court of appellate jurisdiction determines in a final and nonappealable judgment that the burden of proof described in subdivision (b) is unconstitutional, a grandparent filing a complaint or motion under this section must prove by clear and convincing evidence that the parent’s decision to deny grandparenting time creates a substantial risk of harm to the child’s mental, physical, or emotional health to rebut the presumption created in subdivision (b).

(5) If 2 fit parents sign an affidavit stating that they both oppose an order for grandparenting time, the court shall dismiss a complaint or motion seeking an order for grandparenting time filed under subsection (3). This subsection does not apply if 1 of the fit parents is a stepparent who adopted a child under the Michigan adoption code, chapter X of the probate code of 1939, 1939 PA 288, MCL 710.21 to 710.70, and the grandparent seeking the order is the natural or adoptive parent of a parent of the child who is deceased or whose parental rights have been terminated.

(6) If the court finds that a grandparent has met the standard for rebutting the presumption described in subsection (4), the court shall consider whether it is in the best interests of the child to enter an order for grandparenting time. If the court finds by a preponderance of the evidence that it is in the best interests of the child to enter a grandparenting time order, the court shall enter an order providing for reasonable grandparenting time of the child by the grandparent by general or specific terms and conditions. In determining the best interests of the child under this subsection, the court shall consider all of the following:

(a) The love, affection, and other emotional ties existing between the grandparent and the child.

(b) The length and quality of the prior relationship between the child and the grandparent, the role performed by the grandparent, and the existing emotional ties of the child to the grandparent.

(c) The grandparent’s moral fitness.

(d) The grandparent’s mental and physical health.

(e) The child’s reasonable preference, if the court considers the child to be of sufficient age to express a preference.

(f) The effect on the child of hostility between the grandparent and the parent of the child.

(g) The willingness of the grandparent, except in the case of abuse or neglect, to encourage a close relationship between the child and the parent or parents of the child.

(h) Any history of physical, emotional, or sexual abuse or neglect of any child by the grandparent.

(i) Whether the parent’s decision to deny, or lack of an offer of, grandparenting time is related to the child’s well-being or is for some other unrelated reason.

(j) Any other factor relevant to the physical and psychological well-being of the child.

(7) If the court has determined that a grandparent has met the standard for rebutting the presumption described in subsection (4), the court may refer that grandparent’s complaint or motion for grandparenting time filed under subsection (3) to domestic relations mediation as provided by supreme court rule. If the complaint or motion is referred to the friend of the court mediation service and no settlement is reached through friend of the court mediation within a reasonable time after the date of referral, the complaint or motion shall be heard by the court as provided in this section.

(8) A grandparent may not file more than once every 2 years, absent a showing of good cause, a complaint or motion under subsection (3) seeking a grandparenting time order. If the court finds there is good cause to allow a grandparent to file more than 1 complaint or motion under this section in a 2-year period, the court shall allow the filing and shall consider the complaint or motion. Upon motion of a person, the court may order reasonable attorney fees to the prevailing party.

(9) The court shall not enter an order prohibiting an individual who has legal custody of a child from changing the domicile of the child if the prohibition is primarily for