If I go to pillage a city do I have to defeat the whole army?
Yes or you have to have a 3:1 advantage (unsure on the exact ratio).
If by sea do I have to defeat their navy and army?
If they have a navy, you will have to defeat it and the army in order to pillage.
If I pillage and the person is off line is there anyway they know who did it?
Yea, they get a battle report just like yours.
If their online will they see my troop movement and know Im coming?
Yes and they could build up some forces or ship their goods out, depending on the amount of time they have to prepare.