Best solution is to start BIG - start with a least 30% more wine volume than the amount of finished wine you want. AVOID using water to top off. I've done that before but it does dilute your wine down and unless you are really into doing a lot of math calculations you won't have any real ideas of the ABV for the finished wine if you add water PLUS your flavor will be diluted too.
Just start out with say 6 to 6.5 gallons for a 5 gallon batch and when you rack save what ever is left over from filling the carboy. Put that leftover in a fridge for a day or two and then pull off the clearest portion of that leftover wine. To do this right you need to have a number of smaller airlock-able containers like 12oz, 16oz, 20oz 32oz and even 1/2 gallon containers. Airlock them just like the 5 gallon carboy (Or whatever size carboy you is your primary container of wine.) Then as you rack later on, you can top off and move the extra wine into smaller containers maintaining minimum headspace in your original and the extra wine containers.
As to the 1st and 2nd ferments - The better terminology if just to refer to it as one fermentation that is progressing down to a point where the SG is below 1.010. The only "2nd fermentation" would in reality be if you do an MLF with the wine. (Not often done with Fruit wines such are you are talking about.)
Most times I let my ferment go in an 'open' topped bucket that is just covered with a good muslin cloth, towel or Linen sheet material. The gasses coming off the wine will displace the Oxygen and protect the wine until it gets to a point where the ferment is about finished. That point is often easy to see as the layer of foam/bubbles on the surface thins out to just some "Islands" of foam on the surface. That normally happens when a good ferment is somewhere around about 1.010 for me. THEN I rack to a carboy -
SLOWLY - and not filling the carboy completely. When you do that racking it often will incite the fermentation/gassing off to the point that you can get that ugly "Foam Fountain" that eveyone hates. So by going slow and leaving plenty of head space for the ferment to finish, you can usually avoid that messy foam fountain. The alternative would be to snap a lid (And Airlock) on the bucket when the SG gets to 1.010 or below and allow the ferment to finish in the bucket. Even when the ferment is finished, it should still be giving off a lot of CO2 for several days.
SO what some folks call the "Secondary Fermentation" is actually just the point at which the choose to rack to a carboy.
For me that point has to meet two criteria:
1) SG is at or below 1.010
AND
2) Very little foam i present and that shows me that a foam fountain is not likely to occur if I am
careful in that racking.
So as far as racking goes this is what my typical process looks like for a FRUIT wine like Pineapple/Mango, Peach, or any other fruit:
1) First racking when the above 2 points are reached or sometimes in a fast ferment, the wine ferments so fast it drops below .995 that I never even see it at 1.010. It's at this point that I am also filling up those extra containers of wine and getting rid of the gross lees/pulp.
1a) If the wine was racked before fermentation ended, once the ferment stops I will rack again and leave the lees behind. (Again that's when you can put the extra wine into those extra smaller bottles and chill them to drop lees faster) Also those smaller bottles normally will fit in the fridge.
FOR either 1) or 1a) remember to add the K-meta - You add that when you are certain the fermentation is done. Also when the fermentation is finished, that is when headspace becomes more important.
2) Second racking is often 7-14 days later after the wine has dropped most of the remaining lees and they have compacted a little. Again those extra containers are getting racked too.
3) Then every 3 months I rack again and add K-Meta.
Sorry to be so wordy with my response but hopefully that helps
The photo below shows a Peach wine right racked just before it finished fermenting. (What some would call "Secondary Fermentation.") That wine took over a year to completely clear. You can clearly see the 3 smaller containers I used for the "extra" wine. All of those were used to top off the 3 gallon carboy as the wine dropped lees and cleared.