Your landlord can come into your home to inspect the property for repairs only at a time that is convenient to you, and should give you reasonable notice. Reasonable notice shouldn’t be less than 24 hours unless it’s an emergency.
Your landlord should not need to come round very often to inspect the property. If they are coming more often than you would like, or letting themselves in without your permission, it could be considered harassment. You could try to negotiate with them to agree how often it is acceptable to have the property inspected.
Your landlord does not have an automatic right to have a key to your home unless your tenancy agreement says that this is the case. If you change the locks, you should keep the old keys and the original lock to return to the landlord. If you are unable to reach an agreement, or if your landlord does not keep to an agreement that you have made, get advice.