The master node election algorithm is subject to change and currently has planned improvements.
As of now the master server is whichever server boots up first. However some servers are excluded from being master such as iOS, Android, and the first generation Raspberry Pi.