better question, how did the lucifer even know which planets were the homeworlds? that wasn't ever even touched in cannon. we went from "we have no reason to believe the shivans know the location of our home system" to "this is not the direct route to sol, which should divert the shivans from our true intent" to "the shivans have finally determined the location of sol".

It's very likely from a military standpoint the Shivans were monitoring the Terrans and Vasudan communications for a very long time. I believe they did the same with the ancients.
Supporting facts:
-The Shivans communicate entirely in the electro-magnetic spectrum. So it would be very easy for them to hack radio based systems.
-The Shivans seemed to be very adept in Terran and Vasudan military doctrine. Several times they took advantage of their superior maneuverability over the Terrans and Vasudans moving as if they knew certain fleets were of little importance.
-The Shivans knew the locations of both Vasuda Prime and Earth. However it needs to be stated that in FS1 they make mention that the Shivans are searching for the location of Sol and then later on that they are narrowing the search down. Perhaps they hacked the Allied communications channel but could only decipher a general location and had to do a similar search for Vasuda Prime?
-The Shivans have no interest in planets. This tells me they are both very well off logistically speaking and that they do not need the vast sums of info planets often contain. It also tells me their war is one of extermination not conquest.
-The Shivans, like anyother force would be unable to fight a effective war without certain info beforehand which cascades back to number 1 and 2.
It is very very likely the Shivans destroyed innumerable galactic empires between the Ancient's time and our own. They probably have a very well developed military battle plan. However I think the Lucifer fleet was merely a scouting force. It is stated in FS2 that the Shivan ships of the second war are vastly superior technologically and militarily to the FS1 era ships. To me this means that the Shivan scouting force did it's job, perhaps to research the massive Sub-Space disturbances encountered. And probably were to be the first attack wave, was defeated, and the Shivans assembled the second armada and waited for a good time to strike. I think the second fleet was a full battle fleet designed purely for annihilation. This is evident because the second armada had a much better balanced roster of ships in it. Including carriers, destroyers, planet-killers, cruisers, frigates, corvettes, etc.
Also without ever having been defeated before encountering the Alliance the Shivans would have
at least 10,000+ years of military supremacy. They most likely would have allowed their fleets to stagnate technologically speaking and their military philosophies would have stagnated as well. As they have no need to adapt (why fix that which isn't broken). This complacency is what doomed them to defeat in the First Great War. It is unclear to be if I can claim we won the Second Great War. But they disappeared and we are still here, so maybe yes? So the ships we saw in both wars their designs is most likely at least 10,000 years old. As for before the Shivans met the Ancients? It's stated in game they never knew defeat before it is very likely the Shivans have been conquering for hundreds of thousands of years. I believe the Shivans have a large galactic empire of their own in another galaxy I don't buy they were birthed and sustained in Sub-Space as there is nothing to live off in that universe.