Insert div after every three posts in home.php [duplicate]

The WP_Query object has a property called current_post to indicates which post the loop is currently processing. So you can write a similar condition inside your loop:

global $wp_query;
while (have_posts()) {
  the_post();
  if ($wp_query->current_post % 3 === 0) {
    // your code
  }
  // Your article
}