Thank you for posting here in the Community, @salzersoftware.
Let me assist you with recording the transactions related to the security deposit in QuickBooks Online.
You can post the refund back using a bank deposit to track the funds received from the leased office space. I don't recommend entering it as a sales transaction since the system will recognize it as an income to your business.
For the security deposit, I suggest entering it using Expense or Check going to the vendor. If you're unsure of the account to use, please seek expert advice from an accountant to ensure your books will be accurate and error-free. You'll be using the same account for the bank deposit to offset the amounts.
Additionally, I recommend the following resources for more information about entering a bank deposit, as well as entering expenses in QuickBooks:
Let me know in the comment section below if you have any other questions. Have a great day ahead.