If it be alleged in the complaint and established by evidence, or if it appear by the evidence without such allegation in the complaint, to the satisfaction of the court, that the property, or any part of it, is so situated that partition cannot be made without great prejudice to the owners, the court may order a sale thereof. Otherwise, upon the requisite proofs being made, it must order a partition according to the respective rights of the parties as ascertained by the court, and appoint three (3) referees therefor; and must designate the portion to remain undivided for the owners whose interests remain unknown, or are not ascertained.
Idaho Code § 6-512