The gunman, a 24-year-old Polish citizen, aimed at random people as he drove by the city’s Main Square, a major tourist destination