A.Regardless of the weather, if you are rated and current in the aircraft, you can log PIC time when you are the sole manipulator of the controls, according to FAR 61.51(e)(1), which addresses the logging of PIC time. The new Part 61 introduced sweeping changes last year, but it didn't totally change the distinction between logging PIC flight time and acting as the pilot in command, which is defined in FAR 1.1.
In instrument meteorological conditions, you are logging PIC time when you're the sole manipulator of the controls. Your flight instructor, who has an instrument rating, is acting as pilot in command and is responsible for the safety of flight. He is also fulfilling the requirement of FAR 61.3(e), which says no pilot may act as pilot in command of an aircraft under IFR without an instrument rating.
For an instrument rating, FAR 61.65(d) (2)(i) requires you to receive 15 hours of instruction from an authorized instructor (CFII) in the aircraft category for which the instrument rating is sought. You can log the rest of the required 40 hours with a CFI or qualified safety pilot. FAR 61.65(e)(2) says you can log a maximum of 20 hours in a flight simulator or flight training device, but the time must be "provided by authorized instructor," who proves his "authority" by endorsing your logbook.
Finally, pay close attention to your instrument cross-country flight. FAR 61.65(d)(2)(iii) says it must cover at least 250 nautical miles "along airways or ATC-directed routing," include three different approaches, and you must fly an approach at each airport where you land. If your home airport doesn't have an instrument approach, the cross-country leg you flew to get to it doesn't count toward the IFR cross-country requirement. You'll need to land at another airport that has an instrument approach to make the leg count, and then you can fly home.