Assuming there is no other info we can infer from previous weighing (all balanced/eliminated) then you need to check all remaining coins. We can have at most three unknown coins for last weighing.
Set aside one unknown and compare the other two to reference coin.
- if both tip against reference then both outliers are on the scale.
- if one equals reference coin then the other coin on scale and the one set aside are the outliers
Now the problem with having two outliers is that they could be separate or together on the arms of the scale. And we also can't infer from how the scale tips since the outliers could be light or heavy. And if we set aside coins, then its possible for one to be there or only one outlier on the scale.
This prevents us from eliminating coins on first weighing if the scale does not balance, and we need a reference coin for our second or last compare. This means that we can only load three coins on the first weighing with the rest set aside. [as discussed in comments, possible to have 6 in first weighing, but still 4 unknown in second weighing making total coins 6+4 = 10)
If they all match then we have our reference coins (all three of them), and outliers are in the unchecked coins (no other info can be inferred)
-- But we can't just put all unchecked coins on scale for second weighing, we can't infer anything from that (could be separate/together, or light/heavy). So reference coins need to be used in second weighing, question is how many that will still give us manageable number of unknowns for last weighing.
-- If one arm will be the same as reference then third arm has both outliers, thus second weighing could have tested six unknowns (3 each) and we only need to test three unknowns in the third arm. As mentioned at the beginning this is doable.
-- BUT if other two arms of scale tip the same against reference then outliers are in each arm, and we will need to test both sets (worst case scenario) to identify the outliers in each.
----- This means we can actually test only up to four unknowns (two on each arm) and not six in second weighing. We also need to take note if arms with outliers are lighter/heavier compared to reference.
----- So for last compare set aside one unknown and place three unknown on scale.
-------- If we were looking for lighter outliers then if two arms go up those are the light outliers, if only one arm goes up then other outlier is the coin we set aside. Same logic if looking for heavy outliers. Note that we were able to infer from last weighing without using reference coin because we observed how the scale tipped as additional info.
So far that sequence of comparison allows for 3 unknowns from first compare plus 4 unknowns in second compare (total 7). Last compare just isolates the outliers.
What if first three coins did not match? Then we don't have our reference coin/s and we either have one or two outliers on scale. We don't know for certain because outlier could be lighter or heavier.
-- We can check the two that went up/down (they are of same weight) against two other pair of unknowns, the third coin from first compare is set aside.
----- If the two coins that previously went up still stays up, then both are the light outliers. No need to do third compare. Same logic for heavy outlier (went down) scenario.
----- Remember that both coins are of same weight (result of first compare), so the other scenario is one outlier is in the four unknown just placed (two on each arm) and the other outlier is the coin we set aside.
----- So one of these arms will go up/down same as the coin we set aside earlier, giving us two unknowns to check. Last compare is then to determine which of the two has same weight as the coin we set aside earlier.
This sequence of comparison also allows for 3 + 4 = 7 coins total. It might be possible to solve using more coins (three on each arm) since other logic path has first weighing balanced, and we only have two unknowns in final compare (we can have up to three unknowns for last weighing). But this explanation is already too long. Might do follow-up if I have time to analyze 3 + 7 = 10 coin scenario.
But definitely if the problem had stated that there is only one outlier coin, or its specified that outlier is lighter/heavier, or this uses a 2 arm balance (seesaw) then you could have tested more than 7.