Upon divorce, the property will remain with the owner if:
it was bought before marriage;
the apartment was gifted by relatives or inherited, and there are supporting documents for this.
Such family affairs have their nuances. Even if the apartment was owned by one of the spouses, but during the period of joint life it underwent repairs and its value increased a lot due to joint financial investments, it is considered as joint property.