For example

He would only inherit the house if he graduated from university - it was a contingent legacy