All praise is due to Allah, peace and blessings be upon the Messenger of Allah and upon all his family and companions.
The percentage claimed by the landlord from the compensation received by the old tenant from the new one has a variety of aspects:
First, it is permissible for the old tenant, who is within the timeline of the renting contract, to receive a compensation from the new tenant in return for leaving the rented property. The landlord has no right to claim a percentage from that sum unless it was stipulated in the old contract, or the old tenant approved of it.
Second, the renting contract of the old tenant has ended; therefore, he has no right to claim any percentage of the compensation because possession for benefit came to an end. Consequently, the landlord gets the whole compensation as a down payment from the new tenant.
Some aspects of the compensation received in return for leaving a rented property was addressed by the Malikite scholars, and in this regard one of their eminent scholars called Olaish said: “The shop`s renting period is valid, and the tenant rented it to someone else in return for money. It is permissible for the old tenant to claim money in return for renting the shop as long as his renting period has not ended, but if it has, then the new tenant has the right to claim the sum which he had paid to him.” [Fatih Al-Ali Al-Malikvol.2 pp.250].
Rulng No.(31) of The International Islamic Fiqh Assembly states: “ It is permissible for the old tenant to receive a compensation from the new tenant during the old renting period in return for leaving him the rented property until the end of the renting period. This is provided that the renting contract between the landlord and the old tenant is taken into consideration as well as the effective laws and regulations which are consistent with the Islamic rulings. According to some laws, concerning long-term rentals, it is impermissible for a tenant to rent the rented property to another, or to receive a compensation for leaving it to him except with the consent of the landlord. But, if the old and new tenants reached an agreement after the end of the old contract, then compensation to the old tenant is not due.”And Allah knows best.