it depends from an aircraft certification, most SEPs require 1 crew so P2 is considered supernumerary and as such - hours should not be logged, however - An 2 is also a SEP, but for some operations may require 2 pilots.
nothing to do with class rating really