"A player who declares for the draft and stays in it loses his college eligibility when he is drafted. He can sign with any agent following an evaluation from the NBA Undergraduate Advisory Committee, and if he ends up undrafted, he has the opportunity to return to his school for at least another year only after terminating all agreements with that agent, effective with the 2019 draft;[29] until 2018, college players lost their eligibility when they signed with their agents and stayed in the draft, only to be left undrafted.[30] Before 2016, the NCAA only allowed a player to enter the draft once without losing eligibility,[27] but current NCAA rules now allow players to declare for and withdraw from multiple drafts while retaining college eligibility.[28] The CBA allows a player to withdraw twice.[25]"
https://en.wikipedia.org/wiki/Eligib..._the_NBA_draft