score:7
Entering and leaving a country with different passports is indeed not advised. If the country uses computerized records (like the US), the entry and exit could conceivably fail to be matched and you risk being marked as an overstayer. If the country rely on stamps and checks passports on exit (like the Schengen area), border guards will demand to see the passport you used to enter.
But that's not necessarily what your friend did. For example, he could have done this:
In all cases, he would have entered and leaved each country with the same passport. Two things are important here:
Since Venezuelan and Costa Rican citizens can all enter the Schengen area without visa, it does not really matter and your friend probably used his Costa Rican passport on the European side (especially considering the fact that in the Schengen area you need a passport valid for some time after the planned departure date). What would be tricky is if your friend was, e.g., a citizen from Venezuela and Columbia (don't know if that's actually possible). Since Columbian citizens need a visa to visit the Schengen area, he would really need to use the Venezuelan passport. But since that passport was expiring, he shouldn't be able to enter.
Alternatively, he might just have been lucky.
Note: Travelling with two different passports explains all this very clearly.