Arnold uses something called LPE(Light path expression) to set AOVs,Using those expressions we can seperate the AOVs per light group basis.
set some name AOV Light group parameter in the arnold light
create AOV in arnold render node
set the LPE to get desired results.
Example:
beauty per lightgroup - C.*<L.'lightgroupname'>
Here are the available expressions - https://support.solidangle.com/display/A5ARP/Light+Path+Expression+AOVs
To export custom attribute as crytomatte, need to make sure few things as follows
Attribute needs to be Primitive attribute, point attributes simply doesnt work.
Attribute needs to be a string attribute
for example : you cannot use @id to create custom cryptomattes, instead you will need to create new string attribute something like s@piece_id = "piece_1"