Keep your hands in a plane in front of your head. Whenever your hands are in the same plane as your head or behind, then you are off-balance.
Furthermore, keep your arms bent slightly and not like a stiff rod. You want to be able to counter your opponent's attempts to break your grips (in gi and nogi) and get underneath to arm-drag you (both gi and nogi).
Keep you head up. You want to be with your face almost exactly perpendicular to your opponent's body/the mat. This means you will have to look down with your eyes but not turning your head, but that's ok. Bowing your face towards your opponent makes it easier for him to hook around your head (both gi and nogi) or grip your gi (in gi).
Make sure you are pinning his hips instead of just his chest. You have to attack his hips primarily and move them away to break the guard. Also be sure not to take large jumps or be really stiff. You can be strong, but not extremely inflexible with your arms. Stiff arms are easy for your opponent to guide away, but loose and relaxed arms are hard for him to move and is easier for you to counter his motions (like hand fighting). This goes hand-in-hand with not spazzing out. The less of a spaz you become truly, the less rigid your arms will be.
Finally, keep your elbows in. You should feel like your arms are turned inward like when driving a car steering wheel at 9:00 (or less) and 3:00 (or more) or even closer to the bottom of the wheel. If you elbows are facing outward, your opponent can grip them and pull your posture apart. It also helps prevent armbars and triangle chokes. I'm not talking about jamming your elbows into his thighs (a stupid technique) but keeping your elbows from being used as handles for him. Think of this as though you are a little tyrannosaurus with dinosaur arms.
Oh, and for leg position, always widen before narrowing. E.G. If you are doing the knee-in-butt guard break, then you should extend your leg to the side FIRST and then put your knee in his buttock. Doing the opposite narrows your base and makes it easier to be swept.
Michael Jen produces a great DVD called Ultimate Guard Passing which explains these details very well.