In space when the Rebels attack you and it looks like they have a large force against you and it appears hopeless, do not auto-resolve and do not give up. The Rebels tend to jump to hyperspace if there are transports in the battle. They will know at all times whether your planet is guarded or not and strike the moment you leave a planet venerable to attack on land or in space. The Rebels can see every move you make, and can also with a small force, slip past any blockade you may have set up. Never leave a planet unguarded in space or on land. However, build these last as the bigger your base is, the more turbolaser towers you get.
If you can, also build a shield generator and/or turbolaser towers.
Try to keep every planet in your control well defended on space and land with at least one Victory Class Star Destroyer and a level 2 or 3 space station in space.