I bought a house with land but didn't record the deed right away a year later the IRS placed a lien on the property in the previous owners name can they legally do that?

You need to speak to a lawyer (attorney) about this, the lien needs to be removed or you will have trouble selling the property in future. You will need to prove when you purchased the property and that you payed for it in full (or with a mortgage).