Rebel command insignia

Rebel command insignia, were badges of military rank used by officers of the rebellion  and later by the Alliance to Restore the Republic's military.

Inherited from the Alderaan military, they consisted of pips arranged on a brushed-metal backing. For example, the insignia of a captain comprised two equally sized dots centered on the same vertical line, as exemplified by Captain Hera Syndulla of the rebellion, and Captain Cassian Andor of the Alliance. The Alliance generals Dodonna, Willard, Draven, and Rieekan all wore a badge with five dots arranged in a quincunx. As a commander, Luke Skywalker wore a 3-blue rank badge with the double-dot row at the bottom. Major Bren Derlin's badge had three red dots arranged with two in a bottom row and the remainder above and between them.

Behind the scenes
According to the Legends roleplaying book Rebel Alliance Sourcebook, the color of the pips indicates the branch of service, with blue designating navy and red designating army. This was partially retained in the canon reference book, Star Wars: Rogue One: The Ultimate Visual Guide. However, other canon material shows the existence of plaques combining both colors, such as that of General Willard.