how can i store which button was pressed last time among many...

Write some code and test it.

You don't need the pin number in eeprom for this; your code should know that the first bit (or byte) in the eeprom belongs to a certain pin, the second one to another pin and so on.

The eeprom.put() function will only write to eeprom if the value that you are writing did change prolonging the life of the specific cell.