when message relay by any node how can other node know that it is for him and update status.
for example if I subscribe some nodes to 0xc001 group and others to 0xc002 group now if one client publish the group address 0xc001 how others node know that relay message is not for them.I mean where is the address comparison for subscribe mode in light_server_generic_onoff_server code in sdk _mesh_2.2?
Not sure if I understand what you mean here.
If the client publishes a message using i.e the 0xc001 address, the servers that are subscribed to the same address will know that the message is for them when they receive it.
You can take a look at the links below for some information about the SDK for Mesh, and Mesh in general:
Quick Start Guide for the nRF5 SDK for Mesh
Basic Bluetooth Mesh concepts
The nRF5 SDK for Mesh architecture
Best regards, Joakim