Upvote:1
When you enter, Iceland wants you to be able to leave. To make sure that you can go home again, they insist that your passport is valid several months beyond your planned date of departure.
Iceland also wants you to have a valid visa while you stay. That means when you arrive your visa should be valid to the day you are planning to depart, and you should depart before it expires. It might be a good idea to save yourself stress and have a day or two to spare, in case of delays or changes in plans, but that is not required.
Upvote:2
The three month requirement applies to all passports (except EU/EEA ones), no matter whether they are visa-exempt or not. So the point is not to require in particular that "visa-exemptness" lasts for three months after departure, which I think is the source of your confusion.
The visa, if you need one, only needs to be valid on the days you're actually present.