That’s a result of the previous user not logging out of their account and not doing a factory reset before selling it. As of Android 5.1, all Android devices have what is called FRP for Firmware Reset Protection. There's a way to bypass it, which is a pain, but it can be done. I came across that same issue when I tried to reflash it. Here’s a way to do so. It must be followed carefully. After that, you can do a factory reset and be able to use it. Here’s a link of how to bypass the FRP:
https://forum.xda-developers.com/s7-edge/help/frp-bypass-o-otg-odin-samsung-device-t3533200