Oswald owned the rifle, was seen with the rifle, and was seen carying something into the building, CBS or someone did a laser trajectory on the injuries to JFK and Gov Connally, and they all came from the 6th floor window. Oswald's rifle was found there.
the fact that he was working at the book building was a coincidence, Ruth Payne who Marina Oswald was living with got him that job based on info from a friend. He then fled the building and killed JD Tippit the Dallas PD officer and then was arrested.