I will be travelling to France and Switzerland with Family. Stay in both France and Switzerland is 5 days. As I am travelling through Lufthansa my port of entry and exit is Germany but I am not staying in Germany other than transit. In this case, should I be applying for Visa through germany?
The rules telling you where to apply exist to spread the workload between the different countries participating in Schengen.
You must apply to the country that is your main destination. The main destination is the country you spend most time in. If you plan spending an equal amount of time in two countries you need to apply to the first of the two.
So if you got to France first you need to apply to a French consulate.