Answer:
Pyramid trigonal and trigonal planar, respectively.
Explanation:
The shape of a molecule is how the atoms are organized in the space, and it happens to minimize the repulsive force of the bonds and the lone pairs of electrons. Thus, in the molecules given, the two N atoms are the central atoms, because they can do the most number of bonds.
Nitrogen has 5 electrons in the valence shell, so it can do 3 bonds to be stable with 8 (octet rule), and fluorine has 7 electrons in the electron shell, so it can do 1 bond to be stable with 8.
In the molecule of N2F4, the two nitrogen do a simple bond between then, and simple bond with 2 F each, as shown below. So, each nitrogen still has 1 lone pair of electrons. To minimize it, the better shape is the pyramid trigonal.
In the molecule of N2F2, the two nitrogen do a double bond between them, and a simple bond with one F each, as shown below. They still have lone pairs, and the double bond is stiff, so it doesn't rotate. Thus, the trigonal planar shape is the better one.