There are limitation on what the iMac can drive.
https://support.apple.com/en-us/HT206587
In short the iMac with the M395X can drive two external 4K displays, or 1 external 5K display (connected with two cables).
All other iMacs can drive a single external 4K display, or two non-4K displays.
So if this is something you really want, you need to upgrade to the M395X (and I would suggest waiting until the expected October updates come out, because they will feature improved graphics cards). Rumor has it the October release will also feature an Apple external 5K thunderbolt display, but my guess is the iMac will still only be able to drive one of them.
If it were me, I'd wait and get the iMac released in October with the best graphics card option then get two Dell P2715Q displays to go with it (Those are 27" IPS+LED+SST displays, but they are 4K instead of 5K so they won't be a perfect match) you are likely to get two of those for the price of single Apple 5K Thunderbolt Display. Though two matching 5K displays might actually be nicer than a 4K(UHD)+5K+4K(UHD) setup.
I don't think you will be able to drive two external 5K displays with an iMac unless Apple surprises everyone and releases an iMac with dual high end graphics cards. Remember a single 5K display has almost as many pixels as two 4K UHD displays.