Duke Nuno Il Vimaranes is a start in 1066, you need to Play as any Ruler in 1066 and he is a Vassal of King Garcia of Galicia. Form Portugal is a major decision you can take and you need to completely control Beja and Algarve without losing any other land and have 300 gold.
Restart if Nuno doesn't have perks in the Intrigue tree, the perk you want is Kidnapper. You want to start a Kidnap scheme against Emir Abu-Bakr ibn Abdallah of the Aftasid Emirate. Once you get within 1 month declare a Holy War for the Duchy of Beha (you can change objective if it doesnt choose the one you want). Make sure you dont have him in jail before you start the war as you want be able to declare war.
Hopefully soon after the war starts you will Kidnap and you will be able to enforce your demands. From there you may have enough levies to declare a war on Sheikh Abu-Bakr for the Duchy of Algarve (if not use the Kidnap trick again).
With both those under your possession use the decision to form Portugal and the achievement is yours.
To do this without the Kidnap trick use the Meritocracy perk to make a scheme against your King and take his title to give you the strength to win those wars without tricks. Revoke the titles of your counts so you can strengthen yourself beforehand.