Retaining guard...big question.
Always keep their posture broken if possible. This is true in every guard, all the time ( I can't think of an exception). Very hard for them to pass if they can't get posture/balance.
A rule of thumb for open guards is to always have at least as many grips on them as they have on you. If you get dominated on the grips, you'll get passed eventually.
I have found that if I have one lapel or sleeve and can keep at least one foot in the hip, I never get passed. This is not necessarily easy to maintain, but if I concentrate on achieving this sort of position I can always mess with their posture and prevent the pass.
Learn when to bail to half guard rather than trying to retain full guard. If you have the choice between going to half now versus getting passed in a few seconds, go to half now and fight from there. Make the passer work for every stage of the pass. Holding on too long just lets them setup the pass finish.
Finally, a good drill to work on guard retention is the recomposition drill. Basically, your partner kneels and holds out their arms, palms up. You have one leg across their their midsection (shin shield style) and the other leg then comes over their head and across their body, so that your top leg is between you and them and your top foot is on their far shoulder/bicep. You then use that leg to lift your hips, switch your hips, let your top leg fall to their midsection in the shin shield, and throw what was your bottom leg over them head to their far shoulder. Repeat. This is an excellent guard retention drill.