Lyles attended DeMatha Catholic High School in Hyattsville, Maryland, where he was a combo guard. As a freshman, he was teammates with future NBA All-Star player Victor Oladipo. In his junior season, he averaged 11 points and three assists per game and helped his team reach the Washington Catholic Athletic Conference finals. As a senior, he averaged 13.4 points and 4.3 assists per game but his team finished with a 14–17 record, one of the worst seasons in program history. Lyles also played for Team Takeover on the Amateur Athletic Union circuit, competing alongside Josh Hart. Lyles was rated a consensus three-star recruit and chose to play for VCU in college despite drawing interest from Oklahoma State, who gave him an offer, as well as Penn State and Virginia Tech.
College career
Lyles competed for the VCU Rams as a freshman in 2013–14 under head coach Shaka Smart, averaging 0.7 points, 0.2 rebounds, and 0.3 assists in only 2.9 minutes per game. He only recorded two field goals in the season, scoring a season-high three points on two occasions, against Fordham and Rhode Island. Following the season, he transferred to play for the Robert Morris Colonials but was forced to sit out in 2014–15 due to eligibility rules. After one semester at Robert Morris, Lyles transferred to the University of Maryland, Baltimore County, where he would play for the Retrievers starting in the 2015–16 season. He made an instant impact as a sophomore for UMBC, averaging 23.0 points, 5.5 rebounds, and 2.8 assists per game and garnering second-team All-America East Conference accolades. In his junior season, Lyles averaged 18.9 points, 6.6 rebounds, and 2.6 assists en route to second-team All-America East honors. He scored a total of 604 points, breaking the school record for most points by a junior. Lyles made his senior debut on November 10, 2017, in a loss to SMU, scoring 24 points with five assists for UMBC. In his next game, he recorded 31 points, five rebounds, four assists, and three steals in a defeat to Arizona. On November 19, Lyles had a double-double of 26 points and 11 rebounds against Colgate. He scored a season-best 35 points to help UMBC beat Hartford on January 15, 2018. By the end of his regular season campaign, Lyles was named first-team All-America East. On March 10, in the championship game of the 2018 America East Tournament vs. Vermont, Lyles scored 27 points, including a game-winning three-pointer with 0.5 seconds left in regulation. He was named most outstanding player of the tournament. On March 16, at the first round of the 2018 NCAA Division I Men's Basketball Tournament, Lyles notched a game-high 28 points, shooting 9-of-11 from the field, to lead UMBC to a 20-point upset over top-seeded Virginia. The game marked the first time in tournament history that a 16-seed defeated a 1-seed. After his performance, Lyles drew national attention, being featured in stories by The Washington Post and USA Today.