Castile Soap has a shelf life of 3 years but the Castile Soap will likely still be good and safe for use after the the 3 years but it may lose it's effectiveness at killing bacteria or cleaning as good.
The Castile Soap should do you no harm if you do use it past the 3 year shelf life but most people will already use up the Castile or any other soap before 3 years.