A 2-year overstay is very big, therefore it is very unlikely you will be granted a visa.
For comparison, under rule 320(7B), overstayers are normally barred from re-entering the UK for at least one year, unless they overstayed by less than 90 days and left the UK voluntarily at their own expense.
So I imagine even if you didn’t get a ban you would most likely be refused.
A way you could get accepted is if you have significant proof of ties to your home country to show you won’t stay in the U.K. after your visa expires.
Your spouse visa could get accepted if you plan to apply for settlement and live with your partner.