Legal analysis: as the case may be. First of all, when renting a house, if it is stipulated in the contract with the landlord that it cannot be subletted, then subletting is a breach of contract. The landlord can sue the tenant for breach of contract, either according to the terms of breach of contract or as a defendant. If the written contract does not stipulate this content and there is an oral agreement, then it is necessary to consider whether the oral agreement can take effect. Now, although some landlords stipulate that tenants cannot sublet when renting a house, there are still many tenants subletting. Just because there are many cases does not mean that this is enough.
Legal basis: Article 7 16 of the Civil Code of People's Republic of China (PRC). With the consent of the lessor, the lessee may sublet the leased property to a third party. If the lessee sublets, the lease contract between the lessee and the lessor shall remain valid; If a third party causes losses to the lease item, the lessee shall compensate for the losses. If the lessee sublets without the consent of the lessor, the lessor may terminate the contract.