"Advantage of" vs "Advantage to"

Solution 1:

Advantage to is prefered using with very formal things. For example:

The advantage to living in a big city is that one can have a higher chance securing a good job

The advantages to having family and friends around in your life are ...

Advantage in is used in the opposite way, with small and particular things. For example:

The advantages in brushing your teeth everyday are...

The advantages in having a smartphone are...

Advantage of can be used in both situations (in academic writing I personally will use the two above for a good mark), and in any other situtations in the middle.