how can one build a large fleet and second capital ship and sustain population upgrades for new planets at the same time
i've never been able to do it
What you say is true--it's hard to do it all at one time. You have to assess what's important and what makes for the best long-term investment. If you need to fight early, then having a large fleet will be your best investment. If the enemy is far away or you don't have to fight for some reason, then you can "go eco".
You really need to develop a sense of when you need to "peak" the size of your fleet. When do you think you will actually end up fighting? When do you think you will want to pump out lots of ships? The idea is to be able to maximize the size and power of your fleet at that time. If your scouts tell you that the enemy is far away then you can focus on economic development. But, if the enemy is just two jumps away then you need to prepare to fight.
For example, if you don't anticipate that you'll be fighting for 30 minutes and you continuously pump out ships while sacrificing economic development, you might end up having a smaller fleet 30 minutes out than you would have been able to afford had you made some earlier economic investments. So, to an extent it's all about timing.