No , you dont need to stay in the phills for 21 days before you can marry.
Just get your CNI in the UK ( takes 21 days or 15 in scotland ) , then fly to the phills within 3 months.
Once you get there apply in the British embassy for a local coni - takes 2 hours , you are then free to apply at the local registry office for a marriage licence - wait for a maximum of 10 days then you can marry.
In theory 2 weeks would be enough time but may be a little tight , better your bf tries to be in the Phills for 3 weeks.
Good luck