Excuse me, is it legal for the landlord to show the house to the new tenant during the period of renting and before the house expires?

Hello, since you have rented the landlord's house, you have the right to use it. Although the civil law does not clearly stipulate the "right of residence", it is indeed your legitimate rights and interests. As the saying goes, an effective contract is the law! Moreover, the constitution also stipulates that the basic right of citizens is "the residence of citizens is inviolable", so no one has the right to illegally invade your rented house without your consent. You can justly ask the landlord to go out and come back, so you can sue him for taking the contract comfortably.