Scott Lang was the perfect candidate to be Ant-Man. Hank Pym had done his research on Scott and found out that Scott was not only a brilliant thief, but also highly skilled in electronics. He also knew that Scott had hit rock bottom and had nothing left to lose. Scott had lost his job prospects, his reputation, and his family. Hank “tested” Scott by enticing him to steal the Ant-Man suit from Hank's highly formidable safe. Since Scott succeeded, Hank chose him to be Ant-Man.
But how did Hank know about Scott in the first place? Well, Scott’s crime and conviction were not exactly a secret. Even Baskin-Robbins found out about it. (Baskin-Robbins don't play.) Anyone with access to the internet could learn about his daring heist of VistaCorp, where he hacked into VistaCorp's system.
Scott himself tells the story of how he inherited the Ant-Man mantle from Hank in the introductory chapter of his book, Look Out For The Little Guy! (emphasis added):
And outside of the Super Hero game, Hank started a serious R&D operation known as Pym Technologies. But a few years ago, Pym Tech fell into the unscrupulous hands of people who wanted to exploit his discoveries for use on the battlefield—and to sell the resulting technology to folks we really do not want to be in battle with! By then, Hank had been pushed out of the company that literally had his last name on the door. But he knew what was being planned with his invention, and that it had to be stopped. So he…let’s say “hired” me to recover his creations from Pym Tech.
Whoa, whoa, whoa, Scott! is probably what you’re saying right now. How did we jump from custody disputes to biotech espionage?
Well, right about the time I was stumbling out of prison, trying to find myself, Hank Pym—whom I didn’t know at the time—found me. Hank had done his research on me and knew I was skilled at both electronics and thievery. And most importantly, he knew that I had nothing left to lose.
Unbeknownst to me, he “tested” me by enticing me to steal the Ant-Man suit from his highly formidable safe. Once I succeeded at that, Hank and his daughter, Hope Van Dyne, kinda “stole” me from police custody, offered me the gig (as if I had a choice!), and then trained me to pull off one of the craziest high-tech heists ever.