How was Scanlan able to learn counterspell? We can’t find where bards have access to it in 5e, thinking it may have been a holdover from Pathfinder?The Bardic College of Lore allows you to choose spells from other classes at various levels.
— Matthew Mercer (@matthewmercer) December 21, 2017
PhB p54 magical secrets.