Historically, when is rebellion justified?
Historically, rebellion is justified when the population of a given political entity (for example, a nation-state) feels it has no recourse for the redress of grievances other than a revolt against that political entity. As democratic political systems are, in theory and usually in practice, designed to provide for redress through petitioning of a government elected by the population, and by the rejection of individual politicians and parties perceived as ineffectual or malevolent, rebellion against democratic systems are usually considered illegitimate. Legitimate armed efforts at replacing an existing governing structure or regime usually, then, involves nondemocratic systems, in effect, dictatorships. Thus, the rebellions against the Romanov dynasty in Russia, the Somoza dictatorship in Nicaragua, the Castro dictatorship in Cuba, and the recent uprisings against autocratic regimes across the Middle East are all, to greater or lesser extents, considered legitimate examples of rebellion. In the 13 colonies that would become the United States of America, the acts of rebellion that led to the American Revolution were a reaction against a distant autocrat deemed insensitive to the wishes of the colonies' populations. Whether the Shays Rebellion that immediately followed the Revolutionary War against Great Britain enjoyed such legitimacy is a matter for historians to contemplate. Similarly, the noble efforts of John Brown in seeking to advance the cause of abolition may be viewed as legitimate, but also could be seen as counterproductive or, even, as an early example of political terrorism.
Rebellion is justified when there is no other recourse but to raise arms against a government. A functioning democracy, therefore, is generally considered immune from any such enterprise directed against it.