B has an executory interest. O to A for life, but if A should become Protestant, then to B and his heirs. O to A for life, then to whoever is president of GM and his or her heirs. O to A for life, then if B has reached the age of 21 to B and his heirs. A has life estate.
B has contingent remainder.
O to A for life, remainder to A's heir and his heirs. Shelley's case rule will rephrase this as remainder to A. Merger will give A a fee simple. O to A for life, then to B for life. Vested remainder in life estate. Reversion to O. O to A for life, then to B and his heirs.