You can sell your property during a tenancy however if you list your property within the first 2 months of a tenancy starting, the Tenant has the option of ending the agreement with only 2 weeks notice.
In a fixed agreement, the Landlord cannot make the Tenant leave because they decide to sell the property. The Tenant can stay until the end of the term, and the new owner will become the new Landlord.
If the Tenant is on a Periodic Agreement, and the Landlord requires vacant possession, they must give the Tenant 2 months notice to vacate, or upon signing the contract of sale, the Tenant must have at least 4 weeks notice to vacate.