You can achieve this by modifying your above shared code as following.
$prelimartPosts = new WP_Query($args2);
while ($prelimartPosts->have_posts() ) : $prelimartPosts->the_post();
if (($prelimartPosts->current_post +2) >= ($prelimartPosts->post_count)) {
// This is last post and second last post
get_template_part( 'template-parts/content', 'front-center' );
} else {
// These are all other posts except last and second last posts
get_template_part('template-parts/content', 'front-bottom');
}
endwhile;
If you want to use seperate conditions for each then use the below code instead of above.
$prelimartPosts = new WP_Query($args2);
while ($prelimartPosts->have_posts() ) : $prelimartPosts->the_post();
if (($prelimartPosts->current_post +1) == ($prelimartPosts->post_count)) {
// This is last post
get_template_part( 'template-parts/content', 'front-center' );
} else if (($prelimartPosts->current_post +2) == ($prelimartPosts->post_count)) {
// This is second last post
get_template_part( 'template-parts/content', 'front-center' );
} else {
// These are all other posts except last and second last posts
get_template_part('template-parts/content', 'front-bottom');
}
endwhile;