Every guardian who is appointed as aforesaid, and gives bond when it is required, shall have the possession, care and management of his ward's estate, real and personal, and out of the proceeds of such estate shall provide for his maintenance and education; and shall have also, except as otherwise provided in this article, the custody of his ward. Unless the guardian shall die, be removed or resign his trust (and the court before which he qualified may allow him to resign), he shall continue in office until his ward shall attain the age of eighteen years notwithstanding the ward may marry before that time, or, in the case of a testamentary guardianship, until the termination of the period limited therefor. At the expiration of his trust, he shall deliver and pay all the estate and money in his hands, or with which he is chargeable, to the person or persons entitled thereto. But the father or mother of any minor child or children shall be entitled to the custody of the person of such child or children, and to the care of his or their education. If living together, the father and mother shall be the joint guardians of the person of their minor child or children, with equal powers, rights and duties in respect to the custody, control, services, earnings, and care of the education of such minor child or children; and neither the father nor the mother shall have any right paramount to that of the other in respect to such custody, control, services or earnings, and care of the education of such minor child or children. If the father and mother be living apart, the court to which application is made from the appointment of a guardian, or before which any such matter comes in question, shall appoint, as guardian of the person of the minor child or children of such father and mother, that parent who is, in the court's opinion, best suited for the trust, considering the welfare and best interests of such minor child or children. No corporation or trust company shall be guardian of any minor child or children be entitled to the custody, control, services, earnings and care of the education of such minor child or children, and when any corporation or trust company is guardian of the estate of any minor child or children and neither of the parents of such child or children is living, or is a suitable person to act as guardian of the person of such child or children, then the court shall appoint a guardian of the person of such child or children who shall be entitled to the custody, control, services, earnings and care of the education of such minor child or children. Any corporation or trust company appointed as guardian of the estate of any minor child or children shall, unless for such minor child or children a nonresident of this state may be appointed guardian, be a corporation organized under the laws of this state and doing business in this state, or an authorized banking institution, defined as one authorized to exercise trust and fiduciary powers within this state under section fourteen, article four, chapter thirty-one-a of this code.