See in case of FIFO , it works like a queue . The first one to enter , is the first one to go.
From the table we can see that , Page 3 is the 1st one to be loaded into the memory , right?
Thus when page replacement occurs it will be the first one to go.
Now in the case of LRU , or popularly Least Recently Used Page Must go.
Again from the table we can clearly see that , Page 2 was last referenced at t=306.
And every other page has been referenced after that . Thus Page 2 become the oldest referenced page . Thus when replacement would occur , this page must be replaced.