No i'm asking can two sub panles that are feed from a separaet building share the same ground rod.
Actually I missed one possibility... both panels are fed by the same feeder.
In this case, you still have to have a GES to current code at the separate building. One ground rod is only okay if it is less than 25 ohm to earth. Unless you actually test this to be true, you will need at least one other electrode besides the ground rod. There are required-if-present electrodes which will satisfy the GES requirements. Otherwise, you will have to install another... typically a second ground rod.
Your requirements start at 250.32. The GES requirements at the separate building are the same as for a service with the exception there is no bonding jumper between the GES and the grounded conductor.