Section 5. (a) Complaints under this chapter to establish paternity, support, visitation or custody of a child may be commenced by the mother, whether a minor or not; by a person presumed to be or alleging himself to be the father, whether a minor or not; by the child, whether a minor or not; by the child's guardian, next of kin, or other person standing in a parental relation to the child; by the parent or personal representative of the mother if the mother has died or has abandoned the child; by the parent or personal representative of the father if the father has died; by the authorized agent of the department of children and families or any agency licensed under chapter 15D provided that the child is in their custody; or, if the child is or was a recipient of any type of public assistance, by the IV–D agency as set forth in chapter 119A on behalf of the department of transitional assistance, the department of children and families, the division of medical assistance or any other public assistance program of the commonwealth; provided, however, that if the mother of the child was or is married and the child's birth occurs during the marriage or within three hundred days of its termination by death, annulment or divorce, complaints to establish paternity under this chapter may not be filed by a person presumed to be or alleging himself to be the father unless he is or was the mother's husband at the time of the child's birth or conception.
(b) Voluntary acknowledgments of parentage may be executed by the mother and the putative father, whether either or both is a minor, and may be registered pursuant to section 11 only if the signatures of the mother and the father are notarized. If the mother of the child was or is married and the child's birth occurs during the marriage or within 300 days of its termination by divorce, a voluntary acknowledgment of parentage naming the putative father may be executed by the mother and the putative father only if the mother and the person who was the spouse of the mother at the time of the child's birth or conception sign an affidavit denying that the spouse is the father of the child; provided, however, that where the marriage has been terminated by annulment or by the death of either spouse, paternity of the putative father may only be established by filing a complaint to establish paternity as provided in this chapter. A mother and a putative father signing a voluntary acknowledgment of parentage at the hospital or thereafter at the office of the city or town clerk as part of the birth registration process pursuant to section 3C of chapter 46, with the department of transitional assistance, with the IV–D agency set forth in chapter 119A, with any agency designated by the federal Secretary of Health and Human Services or with any official of a court shall receive notice orally, or through the use of video or audio equipment, and in writing of alternatives to signing the acknowledgment, including the availability of genetic marker testing, as well as the benefits and responsibilities with respect to child support, custody and visitation that may arise from signing the acknowledgment, and subsequently filing the acknowledgment with the court or with the registrar of vital records and statistics as provided in this chapter.
(c) Any agency or person living with such child who is actually furnishing support to the child or, if the child who is the subject of an action under this chapter is a recipient of public assistance, the department of transitional assistance, shall be made a party to any action for paternity or support under this chapter.
(d) The IV–D agency as set forth in chapter 119A on behalf of the department of transitional assistance, the department of children and families, the division of medical assistance or any other public assistance program may not file complaints solely for custody or visitation, but shall be permitted to file actions for paternity or support; provided, however, that said IV–D agency shall be permitted to maintain an action for paternity or support even if issues related to custody or visitation are raised.
(e) In actions under this chapter relative to custody or visitation, the child, if the child is fourteen years of age or older, shall be made a party to such action.