How can I know on which device I get Apple verification code?
Apple ID verification codes will appear on all devices logged into the same primary iCloud account.
On an iOS device, go to Settings → your name and tap on a device in the list. If the device says

This device is trusted and can receive Apple ID verification codes.

then you can expect this device to show the code when you need to log in on another device. All devices which show this message will receive the Apple ID verification code.
Devices only logged into the same account for iTunes &amp; App Stores, iMessage and/or FaceTime will not receive Apple ID verification codes.