"Quick general tips.
1.) Always Always Always Upgrade your harbor. I can't stress enough how many new players don't and leave their assets free for the taking. At a level 12 Harbor, you're protecting something like 13000 of each resource. Regardless of your level, that's enough to protect anything you have from attacks as long as you check back a few times a day. You shouldn't ever lose resources. Ever.
2.) Never ever ever leave your troops outside your harbor. The only excuse to have troops out in the open is if you're planning on raiding in the next 5 seconds or less. Any longer and you risk someone coming by and killing them. There's a reason there's a secure button on the harbor.
3.) Scout your targets before attacking them. Make sure they don't have anything guarding and you won't lose any troops.
4.) Build your offense/defense up slowly every day and little by little, they'll grow. I've been playing for a month and a half now and my offense is strong enough to take an unclaimed presidio alone (although with heavy losses).
5.) Never do prize battles. Any battle where you lose even one fleet/armada unit is a loss. I don't care if you gain 32k rum and 40 juggernaughts from it. You've lost. Because inevitably, you will attack 40 more times... and lose all 40 juggernaughts, one at a time. The only time to do a prize battle is when you can win without taking ANY losses. It requires commitment and self-restraint, but by following steps 1-3... your offense will get large enough that you don't need to worry about losses against prizes. From then on, you'll fly up in levels. (I can currently take out lv. 14 prizes without losing anything. Patience is a virtue in this game.)
6.) Remember... even if the top five guilds in the game all simultaneously come after you... they can't do a thing to you as long as your harbor is upgraded and your ships are hidden. They'll waste their time, ships, and raids getting nothing time after time.
Too many people see an incoming attack, freak out, and put their defenses out. Then they lose them. Just leave them in, upgrade your harbor or USE the resources before the attack. Enemy gets nothing. Enemy doesn't come back.
When I scout a player and they have a defensive army waiting, I make it a point to slaughter it to the man. I don't care if they have no resources. My offense is large enough that I don't care if you have 20 subs and 50 bonnies.... every last one is going to die without me taking significant losses... except that i'll gain a ton of free experience... and now you're set back a month+ of building.
Same with offense. Your offense gets exponentially more powerful the more troops you have. Why should I fight a prize and take 50% casualties, spend a week rebuilding and repeat? I'd much rather build for a couple weeks, and then start fighting prizes for 0% casualties.
Hope this helps."
So here is a Quick Summary:
1) Focus to upgrade your Harbor not to lose resources to raids.
2) Hide your troops inside your Harbor so they don't die from raids.
3) Scout before attacking.
4)+5) Grow slow, don't take risks.
6) Even if whole world attacks you there is only so much they can do if you did (1).