Each town has a defensive rating between 1-10, with 1 being poorly defended and 10 being heavily defended. To check the defensive rating of a town select the dock, and scroll to the left most screen. The rating will be the cannon icon in the top right corner.
Before attempting this achievement you will need at least 3 towns under your control. (It seems the enemy won’t attack you with less than 3) Each town will require a defensive rating of 7 or higher. To raise the defensive rating of a town, you need to build up the population by creating more businesses and bringing in more workers. This is easily done if you have established businesses in town while seeking a peaceful annexation. (By the time you peacefully annex a town, the defensive rating should be at 6 or higher)
If you are planning on taking towns by force, then focus on capturing viceroy and governor towns, as these will have a much higher population already.
Once you have at least 3 towns under your control each with a defensive rating of 7 or higher, save your game as the next part can take a few attempts depending on how the enemy reacts. Firstly, bring all your trade convoys into port, as the enemy has a habit of attacking your ships before they will attack your towns. Next, force the other nations into war by attacking their merchant ships. Once all nations are at war with you, sit back and wait (rely heavily on the x10 speed) until they launch a military convoy towards one of your towns.
When one of your towns is under attack, an icon of a red and yellow ship will appear beside that town on the nautical map. You will not be able to control any aspect of the fight but as long as you still have a defensive rating of 7 or above, they won’t be able to break through your fortresses even after multiple attacks. Each time a town successfully defends itself, you will see a short cutscene that reads “Town Name” was attacked by “Nation.” After the fifth attack on the town, the achievement will unlock during the cutscene.
TIP: You don’t need to defend the town from 5 attacks in a row. You can defend it from 3 attacks, lose the city, recapture it, and defend it from 2 attacks and the achievement will still unlock.
NOTE: This is a difficult achievement because there is no telling when and what town an enemy will attack. There is also a glitch where only the first enemy convoy will be seen while viewing the battle in port. Subsequent ships will be invisible and the only indicator that your town is being attacked is the fortresses will sustain additional damage.