The verification of payments is done by apple based on the apple ID (that identifies a user). They handle all the payment, identify the users and track the usage. We as developers do not get information about that only in aggregated numbers.
BUT - Our apps accept Family sharing - that is handled by apple and allows to use a purchase between several devices belonging to the same family.So if the two devices you are handling correspond to the same "family" then things should work well and you should be able to sue the app on both devices even if they have different Apple IDs.
To set up Family sharing you will need to follow the instructions given by apple (just check Online).