I have an existing lease and I want to leave before the end date. Can I give three months notice or possibly have my friend take over the lease instead?

You will need to review your tenancy contract terms and see if there is any break clause provision for you to request early termination. If this is not available then you should contact your landlord about possible options to accommodate your request and see if they will accept. The majority of residential lease contracts include a clause that states subletting is not allowed. In the event it's omitted from the lease and approval to sublease has not been given in writing then it would be deemed against the law for your friend to take over the lease.