Ok solution found. I forgot to use the {} and now it works. Here goes:
<?php
$query = new WP_Query( array( 'post_type' => array( 'custom_post_type' ) ) );
$i = 0;
while ( $query->have_posts() ) : $query->the_post();
if ($i%2==0){
echo '1st post here';
}
if ($i%2==1){
echo '2nd post here';
}
$i++;
endwhile;
?>