In the Commander format, the default rule is that only legendary creatures can serve as your commander (CR 903.3). Planeswalkers are not creatures by default, so they ordinarily cannot be your commander.
However, some planeswalker cards include the specific text 'can be your commander' printed directly on the card. This text is a special characteristic-defining ability that grants an exception to the normal rule, making that card a legal commander choice (CR 903.3a). Examples include Nahiri, the Lithomancer and Ob Nixilis of the Black Oath from the original Commander 2014 precons.
When a planeswalker is your commander, all normal commander rules still apply: it goes to the command zone when it would leave the battlefield (or to any zone from the battlefield), you may recast it from the command zone paying its mana cost plus 2 for each previous commander tax, and its color identity determines your deck's color restrictions (CR 903.4, 903.9).
Concrete example: You choose Teferi, Temporal Archmage (which has 'can be your commander') as your commander. It begins in the command zone. When it hits the battlefield and its loyalty is reduced to 0, you may move it back to the command zone instead of the graveyard, and cast it again later paying its cost plus the commander tax.
Note: Do not confuse this with planeswalkers that have been errata'd or are natively legendary creatures that also happen to be planeswalkers (like Jace, Vryn's Prodigy which transforms). Those follow separate rules. Only the explicit 'can be your commander' text grants this permission for non-creature planeswalkers.
Unofficial fan resource — not affiliated with or endorsed by Wizards of the Coast. Answers are AI-generated estimates grounded in the Comprehensive Rules and are not a substitute for an official judge. Verify anything match-critical.