If you buy a house before getting married, you can write the names of both parties. As long as both parties reach consensus and are voluntary and legal, both parties' names can be written on the property certificate. Once the names of both parties are written on the property, the property becomes the joint property of the husband and wife. If the house is purchased with a loan, the husband and wife should also be jointly responsible for repaying the loan. In the event of divorce, the property should be divided jointly.
Article 1065 of the "People's Liberation Army and Civil Code of the People's Republic of China" The man and woman may agree that the property acquired during the marriage and the property before the marriage shall be owned by each other, jointly owned or partially. Owned by each, jointly owned by some parties. The agreement should be in writing. If there is no agreement or the agreement is unclear, the provisions of Articles 1062 and 1063 of this Law shall apply. The agreement between husband and wife regarding the property acquired during the marriage and the property before marriage is legally binding on both parties. The husband and wife agree that the property acquired during the marriage shall be owned by each other. If the other party knows the agreement, the debts borne by the husband or wife shall be paid off with the personal property of the husband or wife.