Say I have two passports from two countries, both of which will allow me to stay in country X for 60 days without requiring a visa.

Can I enter with passport A, stay 60 days, then leave and immediately re-enter with passport B to stay for another 60 days?