Recording, not the guitar, but his amp. The most common way to do this is by placing a dynamic microphone in front of the speaker cabinet a few inches from the speaker or the loudspeaker it contains (the further you move the microphone away, the more ambient you will get of the room). If you place and direct your microphone towards the center of the HP, the sound will be shiny. The further away you go from the center, the deeper the sound will be, but the louder the sound. A compromise will often be found by playing on the placement of the microphone and its orientation: it can be placed on the side of the HP bowl by pointing it towards the center of it.
The different microphones available on the market have very different characters and the sound can change enormously depending on the models, especially when the electric guitar is saturated. Do not hesitate to place several microphones in front of the loudspeaker in order to make your choice, and why not leave them all during the socket in order to mix them during the mixing stage. It is a method often used to magnify the sound of the instrument.
Here are some examples of pickups: Shure SM57, ElectroVoice RE-20, Sennheiser MD-421, MD-441 or e606, BeyerDynamic M88-TG or M69-TG.
You can also use ribbon mics like the Royer R121 or the BeyerDynamic M160 with very good results, especially on saturated guitars which can sometimes have an aggressive sound. These microphones will soften the whole.
In support of this first microphone and if the room is worth it, you can use a static microphone a few meters from the amp to bring air to the plug and give a sound a little more natural.
If your neighbors are fussy about noise, there are methods in order to silently record an electric guitar. The easiest way is to use the instrument input (also called Hi-Z, or high impedance) of your digital audio interface, or a D.I. (or direct box) if it does not have one. The D.I. makes it possible to adapt the level and the impedance of the signal of your guitar in order to be able to enter a microphone input (in XLR format) of your audio interface or console. You will then use an amp simulator in your sequencer (Guitar Rig, LePou, Overloud TH2, Peavey Revalver and IK Amplitube) to process the direct sound of your guitar. The advantage of this solution is to be able to modify the sound of your virtual amp after making the plug, practical!
It is also possible to use a hardware amp simulator, as it exists in the form of a pedal or pedal (practice if you also do the scene), rack or bean, that you then connect to the line input of Your audio interface. Look on the side of Tech21, Line 6, Vox or AVID. If you are very much attached to your amp, know that there are solutions, like the French manufacturer Two Notes, that simulate the speaker / microphone to record your amp and pedals … in silence! You can also use a loadbox with a line output and then use a speaker simulator.