Had a landlord that I discovered had been in my apartment without letting me know. Luckily, tenants have quite good legal protections where I’m from. Among other things, we can have the lock changed by a locksmith and bill the landlord for it if they’ve done just that. So I sent them an email with the contact info for a local locksmith, along with the legal text saying I could do just that, and let them know they had burned through any goodwill with their first infraction (which I documented). They apologised and didn’t do it again.
Probably depends on country, but where I’m from, you can’t use lethal force unless there’s danger to “life or health”, that is, you can’t use lethal force against a home invader unless it’s absolutely necessary.
Besides, the most lethal weapon in most peoples homes are the fire extinguisher and kitchen knives.
To be frank: You would never get away with killing a landlord that locked themselves into your apartment while you were home, unless they tried to harm you in some way. Not a burglar either for that matter.
Disclaimer: Obviously, if you confront a burglar, and it develops to a violent confrontation, lethal force can be justified. However, you will be hard pressed on whether you had the option to remove yourself from the situation before needing to resort to lethal force.