(a) Any court of equitable jurisdiction may, upon the complaint of any person interested, order the sale of any property, real or personal, owned by two or more persons, when, in the opinion of the court, a sale will better promote the interests of the owners. If the court determines that one or more of the persons owning such real or personal property have only a minimal interest in such property and a sale would not promote the interests of the owners, the court may order such equitable distribution of such property, with payment of just compensation to the owners of such minimal interest, as will better promote the interests of the owners.
(b) The provisions of this section shall extend to and include land owned by two or more persons, when the whole or a part of the land is vested in any person for life with remainder to his heirs, general or special, or, on failure of the heirs, to any other person, whether the land, or any part thereof, is held in trust or otherwise. A conveyance made pursuant to a decree ordering a sale of the land shall vest the title in the purchaser thereof, and shall bind the person entitled to the life estate and his legal heirs and any other person having a remainder interest in the lands. The court issuing the decree shall make such order in relation to the investment of the proceeds of the sale as it deems necessary for the security of all persons having any interest in such land.