Guild experience (gxp) is gained on a per combat round basis.
In order to get gxp, you must:
1.) Be fighting.
2.) Be unidle.
3.) Be wielding a weapon or in possession.
4.) Deal at least a little damage.
There are bonuses to gxp for the following:
1.) Having the Favor of the Cosmos. info balance
2.) Being in possession.