452.402. Grandparent's visitation rights granted, when--guardian ad litem appointed, when--termination upon adoption--attorney fees and costs assessed, when
1. The court may grant reasonable visitation rights to the grandparents of the child and issue any necessary orders to enforce the decree when a grandparent has been unreasonably denied visitation for a period exceeding sixty days, and:
(1) The parents of the child have filed for a dissolution of their marriage. A grandparent shall have the right to intervene in any dissolution action solely on the issue of visitation rights. Grandparents shall also have the right to file a motion to modify the original decree of dissolution to seek visitation rights when visitation has been denied to them;
(2) One parent of the child is deceased and the surviving parent denies reasonable visitation to a parent of the deceased parent of the child; or
(3) The child has resided in the grandparent’s home for at least six months within the twenty-four month period immediately preceding the filing of the petition.
Except as otherwise provided in subdivision (1) of this subsection, if the natural parents are legally married to each other and are living together with the child, a grandparent may not file for visitation pursuant to this subsection.
2. Before ordering visitation, the court shall, in addition to the requirements of subsection 1 of this section, determine if the visitation by the grandparent would be in the child’s best interests. Visitation may only be ordered when the court finds such visitation to be in the best interests of the child. The court may order reasonable conditions or restrictions on grandparent visitation.
3. If the court finds it to be in the best interests of the child, the court may appoint a guardian ad litem for the child. The guardian ad litem shall be an attorney licensed to practice law in Missouri. The guardian ad litem may, for the purpose of determining the question of grandparent visitation rights, participate in the proceedings as if such guardian ad litem were a party. The court shall enter judgment allowing a reasonable fee to the guardian ad litem.
4. A home study, as described by section 452.390, may be ordered by the court to assist in determining the best interests of the child.
5. The court may, in its discretion, consult with the child regarding the child’s wishes in determining the best interest of the child.
6. The right of a grandparent to maintain visitation rights pursuant to this section may terminate upon the adoption of the child.7. The court may award reasonable attorneys fees and expenses to the prevailing party.