Complex sentence: When he pushes him near the prison bars, he tells a security guard that he was beaten up, (and accidentally slamming the guards head on the bars) he is sent to the hole, which makes Ernest realize he is in jail.
Split into simpler sentences: When he pushes him near the prison bars, he tells a security guard that he was beaten up, (and accidentally slamming the guards head on the bars). A security guard tells Ernest that he is sent to the hole, which makes Ernest realize he is in jail.