Follow instructions https://en-us.support.motorola.com/app/standalone/bootloader/unlock-your-device-a/ for unlocking bootloader firstly for flashing custom recovery u can use native adb and fastboot tools
P.S But for future please use this repo for getting information about how much vendor is evil https://github.com/melontini/bootloader-unlock-wall-of-shame
Not only to unlock also install custom key for bootloader and lock bootloader again same way graphenos doing that