XeF2:
Xe has 8 valence electrons. Each F atom contributes 1 electron to form a bond with Xe. Therefore, Xe uses 2 electrons to form two Xe-F bonds. The remaining 6 electrons exist as 3 lone pairs on the Xe atom.
To minimize electron-electron repulsion, the structure adopts a linear geometry with the two F atoms at 180 degrees to each other. The three lone pairs occupy the equatorial positions in a trigonal bipyramidal electron-pair geometry.
[Diagram of XeF2 showing linear structure with 3 lone pairs on Xe and 2 F atoms bonded at 180°]
BrF3:
Br has 7 valence electrons. Each F contributes one electron, resulting in a total of 10 valence electrons around the central Br atom. Br forms three Br-F bonds, using 6 electrons. The remaining 4 electrons are present as two lone pairs.
The structure of BrF3 exhibits a T-shaped molecular geometry to minimize electron repulsion. The three F atoms and the two lone pairs form a trigonal bipyramidal electron-pair geometry. The two lone pairs occupy the equatorial positions resulting in the bent T-shape for the molecule.
[Diagram of BrF3 showing T-shaped structure with 2 lone pairs on Br and 3 F atoms]