The five countries invited to meet the leaving American president were Germany (the host), France, the UK, Italy, Spain, in addition of course to the US. Those five countries are the five most populated countries in the EU, and also the five with the highest GDP.
It is clear that the aim of this meeting was to allow for an intimate and apical discussion. Inviting people from 28 countries would not have done the job.
If a sixth country had been invited, the natural choice would have been Poland. Poland is the sixth European Country in terms of population, it has a larger area than Italy and the UK, and would also be the sixth country by GDP if we use a PPP comparison (though it has a lower GDP than the much smaller Netherlands and Belgium at the current exchange rate). But the current administration of Poland has very cool relations with the rest of the EU,
especially with Merkel. So it was natural to stop at 5 guests.