hi, how can i configure Xbee S2 to use Home Automation profiles?

You don’t. You use an XBee ZB SMT (S2C) module. The standard XBee ZB module uses an Em250 which did not have the memory to add the items needed for HA. But the EM357 products such as the ZBSMT and the New ZB TH products do have the memory and the functions have been added to the firmware. At least some of the required functions have been.