One does not get "convicted" for being a homosexual, not then, and not now.
What did he actually do to break the law?
One did not get convicted merrely for being a homosexual in those days - no, of course, not - but if you read the article you will find
despite the importance of his work Dr Turing was convicted of gross indecency for having a relationship with a 19-year-old.
At that time homosexuality was illegal, and he chose to be chemically castrated with injections of female hormones rather than go to jail. He committed suicide two years later. If you want to have more detail about the "offence" for which he was convicted in 1952, you hve only to go and look.
That the royal pardon has indeed come decades later than it should have done - particularly in the light of how long various changes in the laws affecting homosexuals in Britain had been in place at the time of its posthumous granting - is as obvious as it is shameful. That Turing was driven to suicide a couple of years after accepting a physiologically and psychologically damaging "medical" "solution" rather than being jailed ought in and of itself to have shamed the judiciary at the time, particularly given his immense gifts and his record in serving his country.