Such petition shall be filed in the circuit court of the county in which such lands, tenements or hereditaments lie; but if the same shall lie in two or more counties, whether in detached parcels or otherwise, said petition shall be filed in the circuit court of the county in which any portion of such premises is situate, and a majority of the parties entitled thereto reside; and in case a majority of said parties do not reside in any such county, or all of them are nonresidents of the state, the proceedings for partition shall be had in the circuit court of that county in which an equal or greater part of such premises may be.
§ 528.040, RSMo