It’s randomly selected between current and previous age goods -BUT- you can logically work it out through process of elimination
To begin with you want to eliminate as many wrong answers as possible by going through as many different options as possible. If something turns green (and you only placed it once that turn) it might still be needed in another spot, so it can’t be eliminated from the pool of possibilities just yet.
Once you get enough (unique) yellows to put one for each slot you can stop eliminating options and just rotate the yellows between slots.
If you get to your final turn and you haven‘t yet pinned down what all the goods required are you’re going to have to make a guess.
If you’re in Guild Expedition you can increase your turns from 3 to 4 through the friends tavern (the extra turn boost only works in the Guild Expedition)