To declare your own kingdom, you must first capture a castle or town while not being a vassal of any faction. The easiest way to do this is to renounce your oath to your current king (if you are a vassal) or simply capture a neutral or enemy fief. Once you own a fief and are independent, you will get the option to declare yourself king/queen of your own kingdom.

This path offers the most freedom but is also the most difficult. You will immediately be at war with the faction you took the fief from, and potentially others. You'll need to recruit lords to your banner, manage your kingdom's finances, and defend your borders against multiple enemies. Having a high Right to Rule score is crucial for convincing other lords to join you and for other factions to recognize your legitimacy. You gain Right to Rule by sending companions on missions to spread your fame, or by marrying into a noble family.