Will clause and lump sum payable to children from sale proceeds of main residence after granting spouse right of occupation

I’d be grateful for views on whether a clause under H’s Will granting W a right of occupation for a period of 3 years after death would be sufficient to secure spouse exemption- whereby after a period of 3 years the property would be sold and a lump sum out of sale proceeds payable to children as provided for within a clause in the Will. No RNRB due to value of the estate but looking to secure spouse exemption on H’s share of the property then upon sale of the property, the sum being paid to children could be treated as a PET from W. Would including the amount to be paid to the children under the Will (subject to spouse’s occupation after 3 years) prevent spouse exemption?