so how do you write solos? do you base them of scales? or what im confused. i just wrote a song but the only thing i cant write is the solo. also is a song better if it has more notes/chords. like if one song only has 14 chords/notes and another song has something like 25 chords/notes in it. is the one with more a better song or not?
I don't think that more chords is equal to a better song. For example, "Smells like teen spirit" has only 4 chords, but it's a great song.
About writing solos, you should listen and try to learn solos that you like, try to see how the harmony is used, what are the choosen notes, the different parts of the solo, etc...
I hope it helps
More doesn't always equal better, it's how tastefully/properly they are used.

So, IMO, solos should embellish on the melody of the song. I'm gonna use some music theory here, so hopefully you understand, if not ask someone who does.

Let's just keep this simple and say the song is in C major. So, you can play your solo in C major, or you can play your solo in the Relative Minor (which would be a) both of these methods work fairly well.

HOWEVER. You can also solo in the modes, so you could use D Dorian, E phrygian, F lydian, G mixolydian, A aeolian (already mentioned this, the relative minor of C major) or B locrian. Because of the difference of the placements of notes to still keep it in the key of C, each mode has it's own feel. An example would be locrian, which is my favorite. Pink Floyd uses it a lot, it has a lot of "trippy" qualities.

So, base the solo off of the melody, which should be written based off of the chord progression of the song. So in a way, it's a mix of scales/modes/chords, it just depends on what you're going for. Just think about the overall feel of the song, since the solo should probably be the highlight of the whole thing, kind of like the climax of a novel. It doesn't always have to be super fast, or technical, sometimes it just has to capture a specific mood.

And them sometimes it really should just shreddyshredshred.
Alright a wise musical lesson i've once learned is say only what NEEDS to be said. Make the song as short AS possible. Solo wise is the same. Its the climax of the song, a release of emotions. So you really have to feel it, you'll probably hear the first few notes inside of you, then the rest should follow along with it on its own