I don’t arrive to do order_by title when i have a conditionnal year in a request

I tried your code and is working fine for me

$args = array( 'post_type' => 'project','posts_per_page' => -1,'year' => date('Y') - 2, 'orderby'=> 'title','order' => 'ASC');

$myposts = get_posts( $args );

The thing is as you can see he is only fetching the posts from 2015. If you don’t have any posts with the publish date from 2015 you will get nothing, but if you want to grab all posts from two years ago until the current year you have to do the following:

$args = array(
    'post_type' => 'project',
    'posts_per_page' => -1,
    'orderby' => 'title',
    'order' => 'ASC',
    'date_query' => array(
      array(
        'after' => date('Y')-2 . ' year ago'
      )
    ),
);

See WP_Query for reference