This Mac is Activation Locked. Without the previous Apple ID and password it is a brick. It was not properly prepared for transfer of ownership. There is no work around for this.
If you bought this Mac used, then you should return it to the seller and ask for your money back.