If you bought the phone and though or were under the impression that it was new and you bought it from somewhere you can return the phone. Return it and get a different one. This phone isn't new and has been used before and has been assigned to someone and their Apple ID. When the phone was restored to new condition it wasn't removed from their iCloud account and unless they remove it, there is no way you're going to get into that phone and it is useless to you. You are going to need to either return it if you can, or if you bought it from someone, then you need to get in touch with them and get them to remove it from their iCloud and Apple ID so you can then set it up under your own account.