Dear Cagri,
Out of the box, you can assign only one company code to a contract. While there is no other participating company code, you can either get the revenue posted to the main company code which is the company participating in the contract and disburse the amount to be paid to the other company code separately either via a vendor payment entry or via a separate real estate contract.
Secondly if both the company codes are participating in the lease agreement, you have to create two contracts with different company codes having the appropriate rental condition and partner information.
Hope this helps.
Best Regards,
Hardik Sharma