Do you have SAS/ETS? If so, you can do this a bit more easily with the convert statement.
If you don't, you're stuck with a counter. Create a counter variable using RETAIN and then delete any less than what you need.
data Pooled_Panel_lags;
set Pooled_Panel;
by Country Year;
Lag_EFWS = Lag(EFWS);
Lag_EFWS2 = Lag2(EFWS);
If First.Country then counter=0;
counter+1;
if counter <= 1 then call missing(lag_efws, lag_efws2);
if counter <= 2 then call missing(lag_efws2);
run;
I can't test it, but this may work as well, make sure to only Keep what you need in each data set.
data want;
merge pooled_panel
pooled_panel (firstobs=2 rename = (efws = lag_efws) keep=(PUT VARIABLE LIST HERE))
pooled_panel (firstobs=3) rename = (efws = lag_efws2) keep=(PUT VARIABLE LIST HERE));
by country;
run;