The court shall ascertain and declare the rights, titles and interest of all the parties in such action, the plaintiffs as well as the defendants, and shall enter judgment according to the rights of the parties. After entry of judgment adjudicating the rights, titles, and interests of the parties, the court upon further hearing shall determine whether or not the premises or any part thereof can be divided among the parties without manifest prejudice to the parties in interest. If the court finds that a division can be made, then the court shall enter further judgment fairly and impartially dividing the premises among the parties with or without owelty. If the court finds that the whole or any part of the premises sought to be partitioned cannot be divided without manifest prejudice to the owners thereof and is not governed by the Uniform Partition of Heirs Property Act, then the court shall order the premises not susceptible of division to be sold at public sale in such manner and upon such terms and notice of sale as the court directs. If the court orders the sale of the premises or any part thereof, the court shall fix the value of the premises to be sold. No sale may be approved for less than two-thirds of the total amount of the valuation of the premises to be sold. If it appears to the court that any of the premises will not sell for two-thirds of the amount of the valuation thereof, the court upon further hearing may either revalue the premise and approve the sale or order a new sale.
735 ILCS 5/17-105