user11083: I have a question and I'm sorry if it sounds very uninformed, I'm not a professional chess player so my interest is mere curiosity. I was wondering if there are examples of illegal positions that require more than a superficial look at the chessboard to be recognized as illegal.
All examples of illegal positions that come to my mind are pretty trivial.

A missing king
Two kings of a color
Too many pieces considering possible promotions (e.g. 4 queens + 6 pawns)
Pawns in the first rank
Pawns in the eight rank
All pawns in the second rank and other pieces in higher ranks (except knights)

It's very easy to see that these examples are all illegal. Are there any illegal positions that require more insights to spot?

user11202: A triple check hasn't been mentioned here, but it's appeared here: Is triple check possible?
@MeniRosenfeld's example 4a covers this but brings up one concrete case that could catch people napping, because without doubled pawns, it might initially seem like there are no captures. Of course, it would have to be disguised a bit better, maybe with white pawns at d4/e5 and black at d5/e4:
[Title "pawn switch"]
[fen "rnbqkbnr/p1pppppp/8/1P6/1p6/8/P1PPPPPP/RNBQKBNR w - - 0 1"]
[StartFlipped "0"]

And to riff on the entombed bishop from @AlexPetrov's second example,
[Title "jumpy rook"]
[fen "7k/8/8/8/p1p5/PpPp4/1P1P4/2B2RRK w - - 0 1"]
[StartFlipped "0"]

The bishop can never have moved, so the a1-rook could never have jumped over it, either. We actually do need both white rooks on the board for this position to be illegal, because it's possible a knight could've gone to b3 and taken the rook on a1 (or a2 or b1, if the game was really weird) and retreated.
I suppose false-flag illegal positions (such as without the rooks) would be their own puzzle.
ETA: Evargalo makes a good point about underpromoting rooks. I should have kept all White's pawns on the board just to make sure. But then the position would seem even more contrived.

user10591: One of the most irregular rules says you cannot castle to escape check. You must move your king, block the check, or capture the checking piece. So, if a king is in check and castles it would not be visually so noticeable.

user10380: Some positions which you might consider relevant are the answers to "illegal cluster" problems. An illegal cluster is an arrangement of units on squares which cannot be part of any legal position, but if you remove any unit from the illegal cluster, then the result is part of a legal position.
Here's a particularly complicated one:
[Title "Dmitri Baibikov, The Problemist Mar 2010, R421v"]
[fen "B7/1np3p1/N1P1p3/RPr1K1p1/pnkp4/P1p5/B1P1P3/RN6 w - - 0 1"]
[StartFlipped "0"]

Dmitri Baibikov specifies "Add units so as to make an illegal cluster". In case you want to solve this problem, I put the answer in a spoiler block:

 (Answer and analysis by Gerd Wilts. I have adapted his notation so as to notate forwards moves; he notated retractions. See P1192196 at PDB.)


 Add wRb2, wPg6, bQb3, bBd5, bNb8. 


 Retro 1. ... Nd6-b7 2. Bb7-a8 N~ 3. Bc8-b7 N~ 4. Bd7-c8 Nf1~ 5. Be8-d7 f2-f1=N 6. Bf7-e8 f3-f2 7. B~ f4-f3 8. B~ f5-f4 9. Be8~ ??? {Black's pawn can't be on f6 because it would check} 10. e7-e8=B f7-f5 11. f6xBe7 (critical position) Bf8-e7 12. Kf5-e5 e7-e6+.
 White then uncaptures dxcR and unpromotes a R on h8, Black uncaptures bxc (B,Q) and hxg (Q,B). But getting from the diagram (after adding units) to the critical position, with Black to retract in both, White necessarily makes an even number of moves and Black an odd number, and neither side can change parity, so the first position is illegal. Removing bPa4 would legalise as White could change parity with Ra4. If we add bRb3 instead of bQ, then removing wPa3 would not legalise as after retracting n.Ra3+ Rb3, bRa3 could not escape to b2.

So the answer to the above problem is an illegal position which cannot be made legal by adding more units. (In any case no more White units can be added because White has 14 and black pawns on c3 and g5 captured the other 2; and not more than one Black unit, because Black has 14 and White's d-pawn now on c6 captured one.) But adding a different set of units might produce a legal position.

user10380: The final position in this sequence is legal. (See Baibikov, "Length records in 'Last single moves?' problems", A15.) It is remarkable in being the lightest-known position in which the last 17 single-moves can be determined, neither king is in check and it is not specified whose move it is. "Lightness" is decided primarily by the number of pieces and pawns in the diagram position. (Baibikov had a further method of determining which of two positions is the lighter if they have the same number, but that needn'r concern us here.)
It can be deduced from the board position that White moved last. While White got into position, Black needed to use up four turns pushing the h7 pawn. Therefore if Black had another turn, Black would have to make another pawn push, beyond the diagram position. Therefore the diagram position is legal with Black to move but illegal with White to move. Similarly, if the black pawn were put on h4 instead of h3, the position would be illegal because Black must have spent only 3 turns pushing the pawn, thus failing to give White enough moves to get into position.
[Title "Dmitri Baibikov"]
[fen "8/Ppp4p/rp6/1k6/n7/KPP5/pPP4P/1b6 w - - 0 1"]
[StartFlipped "0"]
[StartPly "17"]

1. h3 {White must spend 4 turns moving this pawn to h6, so must not use the two-square option} Ka5 {unpinning Black's knight} 2. h4 Nc5 3. h5 Ne6 4. h6 Ng7 5. hxg7 h6 {Black must spend 4 turns moving this pawn to h3, so must not use the two-square option} 6. g8=N h5 7. Nf6 {Ne7? h4 8. Nc6+??} h4 8. Nd7 h3 9. Nb8

White has 7 units, so Black has made 9 captures. White's a-pawn has always been on a2 or b3. So the black bishop on b1 is not the original c8 bishop, but one created by a promotion a2xb1=B. So this black pawn and the one now on a2 are Black's d and e pawns, which have made 3+4=7 captures to reach a2. Together with a2xb1 and a7xb6, this makes 9, accounting for Black's captures of all White's 9 missing units. (These include the c1 bishop. Thus White made the capture d2xc3 when that bishop was still at home on c1, to be captured later by a black pawn.)
Black has 8 units, so White has made 8 captures. White pawns have made at least 6 captures axb3, dxc3, exdxcxbxa, accounting for all but 2 of White's 8 captures. Black's a-pawn has always been on a7 or b6, so White captured e2xd3xc4xb5xa6.
So White's f, g, h pawns can't have captured more than twice between them. One captured on g7 then promoted to wNb8, and two are missing. All Black's 9 captures were on the queenside, by pawns. So White's two missing pawns promoted so as to get to the queenside to get captured. Black's f, g, h pawns had nothing to capture and so never left their files, and the h-pawn is still on the h-file. So, for White's h-pawn to avoid Black's h-pawn and promote, it had to capture to the g-file. If neither White's f nor g-pawn captured, White's f-pawn couldn't have passed Black's f-pawn and so couldn't have promoted. So one of White's f and g-pawns captured, only once, and this means that all White's captures were by pawns.
Suppose that White's latest capture (the one within the scope of my diagram) was not h6xNg7 but f6xNg7. Then White's earlier moves were by a pawn on the f-file. Black's f-pawn isn't in the diagram, so what happened to it? It had nothing to capture, so never left the f-file. It couldn't have promoted, because White's f-pawn was in the way. But it couldn't have got captured, because 6 of White's 8 captures were on the queenside and the other two were fxNg7 and hxPg (to let White's g and h-pawns promote).
So White's latest capture was h6xNg7. Now the kingside pawns that are on the board are on the same file, so the above difficulty doesn't arise. White played either fxPg or gxPf, then White's f and g-pawns and Black's remaining f or g-pawn promote without capture.

user15: If we define "illegal position" as a position that cannot happen in a game using legal moves, I think that the most difficult to spot would be positions that look normal, but are impossible to achieve.
[FEN "2k1rr2/pbpq2b1/1p1p1np1/nB1Pp2p/2P1Pp2/2N2NP1/PPQB1PP1/2KR3R w KQkq - 0 1"]

For example this position looks legal, but indeed there is no way how this position could happen in real game - all 16 black pieces are on the board and yet white has doubled pawns. There could be lots of such positions in which none of the rules you mentioned are broken and yet, the positions are impossible to achieve, for example: 
    [FEN "4rrk1/ppp1bppp/2npbn2/1B6/3NP1q1/1P1Q1N2/P1P2PPP/1K1RR1B1 w Qq - 0 0"]

There is no way white bishop could get to g1.
    [FEN "2krr3/pppbppbp/2n1pnp1/1B2q3/4P3/2N1QB2/PPP1NPPP/R4RK1 w KQkq - 0 0"]

There is no way how white could get two white-square bishops. Yes  they could promote a pawn theoretically, but the only square where this would be possible is d8 and this square is black. So had they done so the bishop would be black-squared (not mentioning the fact that with two pawns on c7 and e7 there is no way how bishop could get away from there.
    [FEN "6k1/p1p1np1p/1p4p1/3Kqr2/8/BQP3P1/P4P1P/1R6 w - - 0 0"]

What was the last move? etc.

user7297: Yes - the less a position looks like a real chess game, the harder it is to spot if it is illegal or not. Sometimes, retrograde analysis is needed to prove a position can be reached in a legal way. For an example, see the starting position of the Horse Concoction by Harry Goldsteen, which can be proven to be legal.
[FEN "8/7P/1P5B/2B1Q1n1/3nn2P/1PRnk1nR/3nnnK1/2B1nQBn w - - 0 1"]

However, as White's pawns have to have captured at least five black pieces, the same position with an additional black piece is illegal:
[FEN "8/1b5P/1P5B/2B1Q1n1/3nn2P/1PRnk1nR/3nnnK1/2B1nQBn w - - 0 1"]


11083: <p>I have a question and I'm sorry if it sounds very uninformed, I'm not a professional chess player so my interest is mere curiosity. I was wondering if there are examples of illegal positions that require more than a superficial look at the chessboard to be recognized as illegal.</p>

<p>All examples of illegal positions that come to my mind are pretty trivial.</p>

<ul>
<li>A missing king</li>
<li>Two kings of a color</li>
<li>Too many pieces considering possible promotions (e.g. 4 queens + 6 pawns)</li>
<li>Pawns in the first rank</li>
<li>Pawns in the eight rank</li>
<li>All pawns in the second rank and other pieces in higher ranks (except knights)</li>
</ul>

<p>It's very easy to see that these examples are all illegal. Are there any illegal positions that require more insights to spot?</p>
 11202: <p>A triple check hasn't been mentioned here, but it's appeared here: <a href="https://chess.stackexchange.com/questions/18064/is-triple-check-possible">Is triple check possible?</a></p>

<p>@MeniRosenfeld's example 4a covers this but brings up one concrete case that could catch people napping, because without doubled pawns, it might initially seem like there are no captures. Of course, it would have to be disguised a bit better, maybe with white pawns at d4/e5 and black at d5/e4:</p>

<pre><code>[Title "pawn switch"]
[fen "rnbqkbnr/p1pppppp/8/1P6/1p6/8/P1PPPPPP/RNBQKBNR w - - 0 1"]
[StartFlipped "0"]
</code></pre>

<p>And to riff on the entombed bishop from @AlexPetrov's second example,</p>

<pre><code>[Title "jumpy rook"]
[fen "7k/8/8/8/p1p5/PpPp4/1P1P4/2B2RRK w - - 0 1"]
[StartFlipped "0"]
</code></pre>

<p>The bishop can never have moved, so the a1-rook could never have jumped over it, either. We actually do need both white rooks on the board for this position to be illegal, because it's possible a knight could've gone to b3 and taken the rook on a1 (or a2 or b1, if the game was really weird) and retreated.</p>

<p>I suppose false-flag illegal positions (such as without the rooks) would be their own puzzle.</p>

<p>ETA: Evargalo makes a good point about underpromoting rooks. I should have kept all White's pawns on the board just to make sure. But then the position would seem even more contrived.</p>
 10591: <p>One of the most irregular rules says you cannot castle to escape check. You must move your king, block the check, or capture the checking piece. So, if a king is in check and castles it would not be visually so noticeable.</p>
 10380: <p>Some positions which you might consider relevant are the answers to "illegal cluster" problems. An illegal cluster is an arrangement of units on squares which cannot be part of any legal position, but if you remove any unit from the illegal cluster, then the result is part of a legal position.</p>

<p>Here's a particularly complicated one:</p>

<pre><code>[Title "Dmitri Baibikov, The Problemist Mar 2010, R421v"]
[fen "B7/1np3p1/N1P1p3/RPr1K1p1/pnkp4/P1p5/B1P1P3/RN6 w - - 0 1"]
[StartFlipped "0"]
</code></pre>

<p>Dmitri Baibikov specifies "Add units so as to make an illegal cluster". In case you want to solve this problem, I put the answer in a spoiler block:</p>

<blockquote class="spoiler">
  <p> (Answer and analysis by Gerd Wilts. I have adapted his notation so as to notate forwards moves; he notated retractions. See <a href="http://pdb.dieschwalbe.de/search.jsp?expression=probid=%27P1192196%27" rel="noreferrer">P1192196 at PDB</a>.)
<br>
<br>
 Add wRb2, wPg6, bQb3, bBd5, bNb8. 
<br>
<br>
 Retro 1. ... Nd6-b7 2. Bb7-a8 N~ 3. Bc8-b7 N~ 4. Bd7-c8 Nf1~ 5. Be8-d7 f2-f1=N 6. Bf7-e8 f3-f2 7. B~ f4-f3 8. B~ f5-f4 9. Be8~ ??? {Black's pawn can't be on f6 because it would check} 10. e7-e8=B f7-f5 11. f6xBe7 (critical position) Bf8-e7 12. Kf5-e5 e7-e6+.
 White then uncaptures dxcR and unpromotes a R on h8, Black uncaptures bxc (B,Q) and hxg (Q,B). But getting from the diagram (after adding units) to the critical position, with Black to retract in both, White necessarily makes an even number of moves and Black an odd number, and neither side can change parity, so the first position is illegal. Removing bPa4 would legalise as White could change parity with Ra4. If we add bRb3 instead of bQ, then removing wPa3 would not legalise as after retracting n.Ra3+ Rb3, bRa3 could not escape to b2.</p>
</blockquote>

<p>So the answer to the above problem is an illegal position which cannot be made legal by adding more units. (In any case no more White units can be added because White has 14 and black pawns on c3 and g5 captured the other 2; and not more than one Black unit, because Black has 14 and White's d-pawn now on c6 captured one.) But adding a different set of units might produce a legal position.</p>
 10380: <p>The final position in this sequence is legal. (See Baibikov, &quot;Length records in 'Last single moves?' problems&quot;, A15.) It is remarkable in being the lightest-known position in which the last 17 single-moves can be determined, neither king is in check and it is not specified whose move it is. &quot;Lightness&quot; is decided primarily by the number of pieces and pawns in the diagram position. (Baibikov had a further method of determining which of two positions is the lighter if they have the same number, but that needn'r concern us here.)</p>
<p>It can be deduced from the board position that White moved last. While White got into position, Black needed to use up four turns pushing the h7 pawn. Therefore if Black had another turn, Black would have to make another pawn push, beyond the diagram position. Therefore the diagram position is legal with Black to move but illegal with White to move. Similarly, if the black pawn were put on h4 instead of h3, the position would be illegal because Black must have spent only 3 turns pushing the pawn, thus failing to give White enough moves to get into position.</p>
<pre><code>[Title &quot;Dmitri Baibikov&quot;]
[fen &quot;8/Ppp4p/rp6/1k6/n7/KPP5/pPP4P/1b6 w - - 0 1&quot;]
[StartFlipped &quot;0&quot;]
[StartPly &quot;17&quot;]

1. h3 {White must spend 4 turns moving this pawn to h6, so must not use the two-square option} Ka5 {unpinning Black's knight} 2. h4 Nc5 3. h5 Ne6 4. h6 Ng7 5. hxg7 h6 {Black must spend 4 turns moving this pawn to h3, so must not use the two-square option} 6. g8=N h5 7. Nf6 {Ne7? h4 8. Nc6+??} h4 8. Nd7 h3 9. Nb8
</code></pre>
<p>White has 7 units, so Black has made 9 captures. White's a-pawn has always been on a2 or b3. So the black bishop on b1 is not the original c8 bishop, but one created by a promotion a2xb1=B. So this black pawn and the one now on a2 are Black's d and e pawns, which have made 3+4=7 captures to reach a2. Together with a2xb1 and a7xb6, this makes 9, accounting for Black's captures of all White's 9 missing units. (These include the c1 bishop. Thus White made the capture d2xc3 when that bishop was still at home on c1, to be captured later by a black pawn.)</p>
<p>Black has 8 units, so White has made 8 captures. White pawns have made at least 6 captures axb3, dxc3, exdxcxbxa, accounting for all but 2 of White's 8 captures. Black's a-pawn has always been on a7 or b6, so White captured e2xd3xc4xb5xa6.</p>
<p>So White's f, g, h pawns can't have captured more than twice between them. One captured on g7 then promoted to wNb8, and two are missing. All Black's 9 captures were on the queenside, by pawns. So White's two missing pawns promoted so as to get to the queenside to get captured. Black's f, g, h pawns had nothing to capture and so never left their files, and the h-pawn is still on the h-file. So, for White's h-pawn to avoid Black's h-pawn and promote, it had to capture to the g-file. If neither White's f nor g-pawn captured, White's f-pawn couldn't have passed Black's f-pawn and so couldn't have promoted. So one of White's f and g-pawns captured, only once, and this means that all White's captures were by pawns.</p>
<p>Suppose that White's latest capture (the one within the scope of my diagram) was not h6xNg7 but f6xNg7. Then White's earlier moves were by a pawn on the f-file. Black's f-pawn isn't in the diagram, so what happened to it? It had nothing to capture, so never left the f-file. It couldn't have promoted, because White's f-pawn was in the way. But it couldn't have got captured, because 6 of White's 8 captures were on the queenside and the other two were fxNg7 and hxPg (to let White's g and h-pawns promote).</p>
<p>So White's latest capture was h6xNg7. Now the kingside pawns that are on the board are on the same file, so the above difficulty doesn't arise. White played either fxPg or gxPf, then White's f and g-pawns and Black's remaining f or g-pawn promote without capture.</p>
 15: <p>If we define "illegal position" as a position that cannot happen in a game using legal moves, I think that the most difficult to spot would be positions that look normal, but are impossible to achieve.</p>

<pre><code>[FEN "2k1rr2/pbpq2b1/1p1p1np1/nB1Pp2p/2P1Pp2/2N2NP1/PPQB1PP1/2KR3R w KQkq - 0 1"]
</code></pre>

<p>For example this position looks legal, but indeed there is no way how this position could happen in real game - all 16 black pieces are on the board and yet white has doubled pawns. There could be lots of such positions in which none of the rules you mentioned are broken and yet, the positions are impossible to achieve, for example: </p>

<pre><code>    [FEN "4rrk1/ppp1bppp/2npbn2/1B6/3NP1q1/1P1Q1N2/P1P2PPP/1K1RR1B1 w Qq - 0 0"]
</code></pre>

<p>There is no way white bishop could get to g1.</p>

<pre><code>    [FEN "2krr3/pppbppbp/2n1pnp1/1B2q3/4P3/2N1QB2/PPP1NPPP/R4RK1 w KQkq - 0 0"]
</code></pre>

<p>There is no way how white could get two white-square bishops. Yes  they could promote a pawn theoretically, but the only square where this would be possible is d8 and this square is black. So had they done so the bishop would be black-squared (not mentioning the fact that with two pawns on c7 and e7 there is no way how bishop could get away from there.</p>

<pre><code>    [FEN "6k1/p1p1np1p/1p4p1/3Kqr2/8/BQP3P1/P4P1P/1R6 w - - 0 0"]
</code></pre>

<p>What was the last move? etc.</p>
 7297: <p>Yes - the less a position looks like a real chess game, the harder it is to spot if it is illegal or not. Sometimes, <a href="https://en.wikipedia.org/wiki/Retrograde_analysis" rel="nofollow noreferrer">retrograde analysis</a> is needed to prove a position can be reached in a legal way. For an example, see the starting position of the <a href="https://timkr.home.xs4all.nl/tour/horse.htm" rel="nofollow noreferrer">Horse Concoction</a> by Harry Goldsteen, which can be proven to be legal.</p>
<pre><code>[FEN &quot;8/7P/1P5B/2B1Q1n1/3nn2P/1PRnk1nR/3nnnK1/2B1nQBn w - - 0 1&quot;]
</code></pre>
<p>However, as White's pawns have to have captured at least five black pieces, the same position with an additional black piece is illegal:</p>
<pre><code>[FEN &quot;8/1b5P/1P5B/2B1Q1n1/3nn2P/1PRnk1nR/3nnnK1/2B1nQBn w - - 0 1&quot;]
</code></pre>
