For he hath made him to be sin for us, who knew no sin; that we might be made the righteousness of God in him.
God made Him who knew no sin to be sin on our behalf, so that in Him we might become the righteousness of God.
Read 2 Corinthians 5