Here is the way an attack should look using the "Plunder Algorithm":
You can only capture up to 50% of the overall resources on a planet. For example,if you attack a planet which has 20,000 metal, 20,000 crystal and 10,000 deuterium, you will get be able to capture a maximum of 25,000 resources overall {(20k+20k+10+)/2}.
1.Fill up to 1/3 of cargo capacity with metal
2.Fill up to half remaining capacity with crystal
3.The rest will be filled with deuterium
4.If there is still capacity available fill half of it with metal
5.Now fill the rest with crystal